diff --git a/app/lib/methods/helpers/parseUrls.js b/app/lib/methods/helpers/parseUrls.js index e0896e3a7..ec2397a36 100644 --- a/app/lib/methods/helpers/parseUrls.js +++ b/app/lib/methods/helpers/parseUrls.js @@ -9,6 +9,11 @@ export default urls => urls.filter(url => url.meta && !url.ignoreParse).map((url decodedOgImage = meta.ogImage.replace(/&/g, '&'); } tmp.image = decodedOgImage || meta.twitterImage || meta.oembedThumbnailUrl; + if (tmp.image.indexOf('//') === 0) { + tmp.image = `${ url.parsedUrl.protocol }${ tmp.image }`; + } else if (tmp.image.indexOf('/') === 0 && (url.parsedUrl && url.parsedUrl.host)) { + tmp.image = `${ url.parsedUrl.protocol }//${ url.parsedUrl.host }${ tmp.image }`; + } tmp.url = url.url; return tmp; });