From e6445b431f9f155b4511d8ceeffaf3a3fded425b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 13 Dec 2018 01:15:30 +0100 Subject: [PATCH] client/posts: fix absolute url on certain domains Use the document base href to generate absolute url. Otherwise the image link send to IQDB/google images will be invalid --- client/js/models/post.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/js/models/post.js b/client/js/models/post.js index be0230c..aea8c4c 100644 --- a/client/js/models/post.js +++ b/client/js/models/post.js @@ -276,7 +276,7 @@ class Post extends events.EventTarget { _user: response.user, _safety: response.safety, _contentUrl: response.contentUrl, - _fullContentUrl: new URL(response.contentUrl, window.location.href).href, + _fullContentUrl: new URL(response.contentUrl, document.getElementsByTagName('base')[0].href).href, _thumbnailUrl: response.thumbnailUrl, _canvasWidth: response.canvasWidth, _canvasHeight: response.canvasHeight,