Fix user impersonation

This commit is contained in:
Julien Nahum
2024-01-16 11:23:16 +01:00
parent a6d3dc0c80
commit b19baaf8f3
4 changed files with 32 additions and 24 deletions

View File

@@ -3,6 +3,7 @@ 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'
}