Repository navigation
fix(common): override configured headers case-insensitively - #2580
Open
zakazaka95 wants to merge 1 commit into
Open
zakazaka95 wants to merge 1 commit into
zakazaka95 wants to merge 1 commit into
Conversation
Preserve the established configured authentication and SDK-version precedence for all accepted header input shapes, while retaining other caller values and SDK output casing. Co-authored-by: Codex <codex@openai.com>
zakazaka95
requested review from
Richard-Dang,
blakecduncan,
brg8,
florrdv,
inakov,
jakehobbs,
niveda-krish,
rado-alchemy and
thebrianchen
as code owners
November 6, 2026 16:37
|
I just pull request
Sent from Yahoo Mail for iPhone
On Friday, November 6, 2026, 16:38, Zaksans ***@***.***> wrote:
Configured authentication and SDK-version headers already override exact-case caller headers. Differently cased names survive the object spread, so fetch can combine caller and configured values, for example Bearer caller-token, Bearer configured-key.
Remove only the case-insensitive copies of headers that the SDK overrides, using a fresh caller-header object before adding the existing SDK keys. Preserve JWT precedence, unrelated headers, caller ownership and output key casing.
Validation:
- Final regressions on the original helper: 4 failures and 177 passes. Corrected stock alchemy/common project: all 181 tests pass, independently repeated.
- Normal pnpm run build:libs: all 5 tasks pass. Scoped documented test:typecheck passes.
- Scoped ESLint/Prettier and normal Husky lint-staged/commitlint hooks pass.
- Other projects requiring chain fixtures and full repository lint were not run. The normal workspace postinstall encounters an existing missing chmod command in halp on this Windows toolchain; locked dependencies and the relevant normal library/test targets were still verified.
The tests construct the actual transport and inspect headers without making requests. No credentials, RPC, wallet or paid service is used. Prepared and independently reviewed with AI assistance.
Pull Request Checklist
- Did you add new tests and confirm existing tests pass? (pnpm test) — all 181 common-package tests pass; chain-dependent projects were not run.
- Updated docs: existing header precedence is preserved; no new public API.
- Commits follow Conventional Commits, verified by the normal hook.
- PR title follows Conventional Commits.
- Breaking-change marker: not applicable.
- Full repository lint:check; scoped lint and the normal staged-file gate pass.
- Followed the contribution workflow within the stated offline validation limits.
PR-Codex overview
This PR focuses on enhancing the header management in the alchemyTransport function by normalizing header names, removing certain headers, and ensuring proper handling of authorization tokens.
Detailed summary
- Updated alchemyTransport in headers.ts to normalize header names and delete specific headers.
- Added tests in alchemyTransport.test.ts to verify header management:
- Case-insensitive header overrides.
- JWT priority over API keys.
- Preservation of caller authorization.
- Retention of exact-case configured headers.
✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}
You can view, comment on, or merge this pull request online at:
#2580
Commit Summary
- 3fb6c82 fix(common): override configured headers case-insensitively
File Changes
(2 files)
- M packages/common/src/utils/headers.ts (12)
- M packages/common/tests/transport/alchemyTransport.test.ts (81)
Patch Links:
- https://github.com/alchemyplatform/aa-sdk/pull/2580.patch
- https://github.com/alchemyplatform/aa-sdk/pull/2580.diff
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
You can view, comment on, or merge this pull request online at: Commit Summary
File Changes (2 files)
Patch Links:
— @Mygee2020 What changes were made in the The changes made in the
The final return structure now includes:
|
This branch has not been deployed
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.
Configured authentication and SDK-version headers already override exact-case caller headers. Differently cased names survive the object spread, so fetch can combine caller and configured values, for example
Bearer caller-token, Bearer configured-key.Remove only the case-insensitive copies of headers that the SDK overrides, using a fresh caller-header object before adding the existing SDK keys. Preserve JWT precedence, unrelated headers, caller ownership and output key casing.
Validation:
alchemy/commonproject: all 181 tests pass, independently repeated.pnpm run build:libs: all 5 tasks pass. Scoped documentedtest:typecheckpasses.chmodcommand inhalpon this Windows toolchain; locked dependencies and the relevant normal library/test targets were still verified.The tests construct the actual transport and inspect headers without making requests. No credentials, RPC, wallet or paid service is used. Prepared and independently reviewed with AI assistance.
Pull Request Checklist
pnpm test) — all 181 common-package tests pass; chain-dependent projects were not run.lint:check; scoped lint and the normal staged-file gate pass.PR-Codex overview
This PR focuses on enhancing the header management in the
alchemyTransportfunction by normalizing header names, removing certain headers, and ensuring proper handling of authorization tokens.Detailed summary
alchemyTransportinheaders.tsto normalize header names and delete specific headers.alchemyTransport.test.tsto verify header management: