Skip to content

Nuxt Scripts injects proxy token into payload even if not used #783

@brtinney

Description

@brtinney

🐛 The bug

Based on this, the only way to not have the proxy token shoved into the Nuxt payload is to not have the secret set, but because it is auto-generated in dev, I can't actually test the payload properly.

The actual issue is that I'd like to calculate an etag for the response via a Nitro plugin, but because the proxy token is being included in the payload for every request, each hash is different. I had assumed that just setting proxy: false for the one script I was including would turn off this inclusion, but it does not.

🛠️ To reproduce

https://stackblitz.com/edit/nuxt-starter-rxyuphdo?file=nuxt.config.ts

🌈 Expected behavior

Don't include the proxy token if it isn't going to be used (or warn that the environment variable isn't set). If it needs to be a flag set at a higher level, that's fine with me.

Obviously, just not including the NUXT_SCRIPTS_PROXY_SECRET for production builds should work fine without any changes, but it is going to yell at me and still not work properly for dev.

ℹ️ Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions