{{ message }}
fix(types): constrain AxiosHeaders index values#11005
Open
pupuking723 wants to merge 2 commits into
Open
Conversation
jasonsaayman
requested changes
Jun 18, 2026
89d08fd to
dd66afa
Compare
dd66afa to
11dfa88
Compare
Author
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.

Summary
Constrain the AxiosHeaders string index signature so dynamic header assignments must be Axios header values instead of any.
🏄 I used an AI coding assistant while preparing this PR, and manually reviewed the issue, implementation, tests, and verification output before submitting.
Linked issue
Fixes #7487
Changes
Checklist
Verification:
Note: Full local module tests require the CI tarball install step. Running them without installing the packed axios tarball into tests/module/* fails at runtime with Cannot find module 'axios', while the targeted typing tests above pass.
Summary by cubic
Tightens
AxiosHeadersindex signature to only allowAxiosHeaderValue,undefined, or callable members. Blocks Promises and objects to improve type safety in both ESM and CJS.Description
AxiosHeadersindexer toAxiosHeaderValue | undefined | ((...args: any[]) => any)inindex.d.tsandindex.d.cts.undefined.Docs
Update
/docs/to:Testing
nullandundefinedvalues.Promiseand object assignments, including inside interceptors.Semantic version impact
Patch: type definitions only, no runtime API changes.
Written for commit 11dfa88. Summary will update on new commits.