Debugging embeddable on amplify
This commit is contained in:
parent
4115b44f1d
commit
a0513c4458
|
@ -1,10 +1,14 @@
|
||||||
export default defineNitroPlugin(nitroApp => {
|
export default defineNitroPlugin(nitroApp => {
|
||||||
nitroApp.hooks.hook('render:response', (response, { event }) => {
|
nitroApp.hooks.hook('render:response', (response, { event }) => {
|
||||||
const routePath = event.node?.req?.url || event.node?.req?.originalUrl
|
const routePath = event.node?.req?.url || event.node?.req?.originalUrl
|
||||||
|
console.log(routePath, !routePath.startsWith('/forms/'))
|
||||||
// const routePath= event.context.params._
|
// const routePath= event.context.params._
|
||||||
if (routePath && !routePath.startsWith('forms/')) {
|
if (routePath && !routePath.startsWith('/forms/')) {
|
||||||
|
console.log(response, event)
|
||||||
// Only allow embedding of forms
|
// Only allow embedding of forms
|
||||||
response.headers['X-Frame-Options'] = 'sameorigin'
|
response.headers['X-Frame-Options'] = 'sameorigin'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete response.headers['x-powered-by']
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue