Repository navigation
[PR] fix: replace egress plugin headers case-insensitively - #6606
Merged
ranxianglei merged 1 commit intoNov 14, 2026
Merged
ranxianglei merged 1 commit into
ranxianglei merged 1 commit into
Conversation
This was referenced Nov 13, 2026
Owner
|
Superseded by #6677 (merged as Landed into master via the real merge commit The fix for #6605 is now in master. Closing this PR as superseded — thanks for the careful, well-tested fix. |
This was referenced Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6605
Problem
A plugin returning
Authorizationdoes not replace an existing lowercaseauthorizationkey. The case-sensitive object merge leaves both entries, and Fetch combines the original and replacement values. The same problem affects other header fields and sequential plugins.The new real HTTP test sends a model request through
startServerwith an actual local ESM egress plugin. On unchanged master, its upstream seesBearer original-test-key, Bearer replacement-test-keyand the request returns 401. With this change, the upstream sees only the replacement placeholder credential and returns 200.Change
Use the existing case-insensitive deletion helper before setting each returned header value. This preserves the plugin's chosen spelling and exact value while extending the existing last-update-wins behavior across casing variants. It also retains case-insensitive deletion and unrelated headers.
This is a two-line correction in the shared egress runner. Direct header mutation, body rewriting, timeout behavior, signing policy, plugin ordering and configuration remain unchanged.
Validation
egress-header-replacement,egress-transformsandissue5688-egress-wiring.npm run typecheck,npm run build,npm run check:unused-exports,npm run check:test-import-graphandgit diff --checkpass.Baseline:
e1f31ad9d5b47500362699a9867819b861c7de96(0.1.213), Node v24.22.1, repository test/storage preloads. Full-suite validation remains with hosted CI on this head.Prior work
All-state egress/header/casing searches and contributor history found no existing fix. #6068 introduces this pipeline; #6117 concerns Trae protocol support. My earlier #6149 fixes throttle identity and #6563 fixes Fetch RequestInit normalization, at separate boundaries.
Suggested triage:
bug,p2,scope/wiring; Topic N — server-side miscellaneous.