next.js
d023213c - feat(app-router): add clientParamParsingOrigins config for cross-origin rewrite header control (#82849)

Commit
1 year ago
feat(app-router): add clientParamParsingOrigins config for cross-origin rewrite header control (#82849) ### What? Adds a new experimental configuration option `clientParamParsingOrigins` that allows selective control over which external origins can receive rewrite headers during cross-origin rewrites. ### Why? Currently, RSC requests only receive rewrite headers for relative rewrites, which limits client parameter parsing functionality for legitimate cross-origin scenarios. This feature enables controlled cross-origin rewrite header transmission while maintaining security by default. ### How? - Adds `clientParamParsingOrigins` as an optional string array to the experimental config - Implements regex-based origin matching in the web adapter to determine allowed origins - Extends the existing rewrite header logic to include allowed cross-origin destinations - Defaults to `undefined` (secure by default) - no cross-origin rewrites receive headers unless explicitly configured
Author
Parents
Loading