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
This commit is contained in:
Robin Appelman 2018-12-13 01:15:30 +01:00 committed by rr-
parent d3cabc4a36
commit e6445b431f

View file

@ -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,