mirror of
https://github.com/elk-zone/elk.git
synced 2024-12-05 03:59:59 +03:00
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 nothing helped, send 404 so the srcset can fallback to the default image
|
||||
throw createError({
|
||||
|
|
Loading…
Reference in a new issue