reject http urls

This commit is contained in:
Shinigami92 2022-12-12 22:13:23 +01:00
parent 174b2b2d83
commit a650b1f369

View file

@ -76,6 +76,14 @@ export default defineEventHandler(async (event) => {
} }
} }
if (!ogImageUrl.startsWith('https')) {
// If the og:image is not https, we can't use it
throw createError({
statusCode: 406,
statusMessage: 'og:image must be https.',
})
}
if (!ogImageUrl) { if (!ogImageUrl) {
// If nothing helped, send 404 so the srcset can fallback to the default image // If nothing helped, send 404 so the srcset can fallback to the default image
throw createError({ throw createError({