forked from Mirrors/elk
reject http urls
This commit is contained in:
parent
174b2b2d83
commit
a650b1f369
1 changed files with 8 additions and 0 deletions
|
@ -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({
|
||||||
|
|
Loading…
Reference in a new issue