remove double slash so the image server doesn't redirect when we don't want to

This commit is contained in:
Sean Yesmunt 2019-11-13 12:36:41 -05:00
parent 4a74ee681c
commit 6f9c9d2052

View file

@ -17,7 +17,11 @@ class CardMedia extends React.PureComponent<Props> {
return <FreezeframeWrapper src={thumbnail} className={className} />;
}
const url = thumbnail ? 'https://ext.thumbnails.lbry.com/400x,q55/' + thumbnail : Placeholder;
const url = thumbnail
? 'https://ext.thumbnails.lbry.com/400x,q55/' +
// The image server will redirect if we don't remove the double slashes after http(s)
thumbnail.replace('https://', 'https:/').replace('http://', 'http:/')
: Placeholder;
return <div style={{ backgroundImage: `url('${url.replace(/'/g, "\\'")}')` }} className={className} />;
}
}