Skip to content

fix: omit Vary for static origin#426

Open
vibhor-aggr wants to merge 1 commit into
expressjs:masterfrom
vibhor-aggr:fix/static-origin-no-vary
Open

fix: omit Vary for static origin#426
vibhor-aggr wants to merge 1 commit into
expressjs:masterfrom
vibhor-aggr:fix/static-origin-no-vary

Conversation

@vibhor-aggr

Copy link
Copy Markdown

Summary

Closes #317.

Do not add Vary: Origin when origin is configured as a static string. Keep Vary: Origin for reflected/dynamic origins, including origin callbacks that return a request-specific origin.

Changes

  • Stop appending Vary: Origin for explicit static string origins.
  • Preserve Vary: Origin for origin callback results and existing reflected-origin paths.
  • Update README header comments and configuration notes for the static-vs-reflected behavior.
  • Add regression coverage for static origins and origin callback results.

Verification

PATH=/mnt/TBT_DATA/nipun/work/tasks/earn-100-legal/workspace/toolchains/node/node-v24.16.0-linux-x64/bin:$PATH npm test
PATH=/mnt/TBT_DATA/nipun/work/tasks/earn-100-legal/workspace/toolchains/node/node-v24.16.0-linux-x64/bin:$PATH ./node_modules/.bin/mocha --require test/support/env --grep 'static origins|origin callback returns a specific origin|regexp|array of origin checks'
git diff --check

Results: full suite passed with 50 passing tests and 100% coverage; focused suite passed with 5 passing tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ability to omit Vary: Origin header

1 participant