Skip to content

Commit 5379482

Browse files
committed
chore: retain existing headers
1 parent 59af702 commit 5379482

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/security-headers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ export default defineNuxtModule({
6464

6565
// Other security headers via route rules (fine on all responses).
6666
nuxt.options.routeRules ??= {}
67+
const wildCardRules = nuxt.options.routeRules['/**'];
6768
nuxt.options.routeRules['/**'] = {
68-
...nuxt.options.routeRules['/**'],
69+
...wildCardRules,
6970
headers: {
71+
...wildCardRules?.headers,
7072
'X-Content-Type-Options': 'nosniff',
7173
'X-Frame-Options': 'DENY',
7274
'Referrer-Policy': 'strict-origin-when-cross-origin',

0 commit comments

Comments
 (0)