NuxtN
Nuxt7mo ago
9 replies
FoudreTower

set request headers for nuxt public assets .output/public

Hello I'm trying to set request header for script files under _nuxt I tried setting routeRules according to this issue https://github.com/nuxt/nuxt/issues/22141

routeRules: {
    "/_nuxt/*": {
      headers: {
        "Cloudflare-Workers-Version-Key": "testenvvar",
      },
    },
  }, 


the problem is the header is set for the response and not for the request ( view img ) is there any way to achieve this ? Thanks
image.png
GitHub
Environment Operating System: Darwin Node Version: v18.16.1 Nuxt Version: 3.6.2 Nitro Version: 2.5.2 Package Manager: npm@9.8.0 Builder: vite User Config: devtools, modules, css, app, routeRules, s...
How can I set headers for resources in the public folder? · Issue ...
Was this page helpful?