Skip to content

Commit f02eb39

Browse files
committed
fix: skip security headers when devtools is active
1 parent e2a7b59 commit f02eb39

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

modules/security-headers.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ import { TRUSTED_IMAGE_DOMAINS } from '#server/utils/image-proxy'
2020
export default defineNuxtModule({
2121
meta: { name: 'security-headers' },
2222
setup(_, nuxt) {
23+
const isDevtoolsRuntime =
24+
nuxt.options.dev && nuxt.options.devtools !== false && !process.env.TEST
25+
26+
// Nuxt DevTools relies on injected client assets and an iframe-based UI in dev.
27+
// Keep strict CSP/frame restrictions for non-dev environments.
28+
if (isDevtoolsRuntime) return
29+
2330
// These assets are embedded directly on blog pages and should not affect image-proxy trust.
2431
const cspOnlyImgOrigins = ['https://api.star-history.com', 'https://cdn.bsky.app']
2532
const imgSrc = [

0 commit comments

Comments
 (0)