From 1593fd87d2fe55de63ab5803c109a7c67e14331b Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Sun, 23 Jun 2024 20:59:18 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20YouTube=20bookmark=20cre?= =?UTF-8?q?ation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/TryGhost/Ghost/issues/20445 - after switching to a browser-like user-agent, YouTube started responding with a "supported browsers" message rather than the actual video meaning bookmark creation failed - when trying other user-agents it was discovered that nytimes.com (why the user-agent was originally changed) had a problem with the github.com address in the user-agent. By switching to using https://ghost.org instead the request was allowed through fixing both YouTube and NYTimes embeds --- ghost/oembed-service/lib/OEmbedService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/oembed-service/lib/OEmbedService.js b/ghost/oembed-service/lib/OEmbedService.js index 83eee585cf..4fddd49466 100644 --- a/ghost/oembed-service/lib/OEmbedService.js +++ b/ghost/oembed-service/lib/OEmbedService.js @@ -7,7 +7,7 @@ const charset = require('charset'); const iconv = require('iconv-lite'); // Some sites block non-standard user agents so we need to mimic a typical browser -const USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9'; +const USER_AGENT = 'Mozilla/5.0 (compatible; Ghost/5.0; +https://ghost.org/)'; const messages = { noUrlProvided: 'No url provided.',