force loading images with https

This commit is contained in:
john 2025-05-20 11:22:59 +02:00
parent 76843ba7e8
commit bc2a15bc40

View file

@ -53,14 +53,19 @@ interface PostMediaProps {
}
function PostMediaItem({ media }: PostMediaProps) {
const url = media.url.toString()
const url = new URL(media.url.toString())
if (location.protocol === 'https:' && url.protocol !== 'https:') {
url.protocol = 'https:'
}
const width = media.width ?? undefined
const height = media.height ?? undefined
return (
<img
width={width}
height={height}
src={url}
src={url.toString()}
alt="todo sry :("
className="w-full h-auto"
loading="lazy"