Fix form show page - clean code

This commit is contained in:
Julien Nahum
2024-01-16 11:46:03 +01:00
parent b25bc8bca8
commit 49088e62bc
3 changed files with 9 additions and 15 deletions

View File

@@ -3,7 +3,6 @@ export default defineNitroPlugin(nitroApp => {
const routePath = event.node?.req?.url || event.node?.req?.originalUrl
// const routePath= event.context.params._
if (routePath && !routePath.startsWith('/forms/')) {
console.error('Not a form, setting X-Frame-Options', routePath)
// Only allow embedding of forms
response.headers['X-Frame-Options'] = 'sameorigin'
}