Skip to content

fix(types): make response headers case insensative#10677

Merged
jasonsaayman merged 2 commits intov1.xfrom
fix/6677-headers-case-sensitivity-issue
Apr 9, 2026
Merged

fix(types): make response headers case insensative#10677
jasonsaayman merged 2 commits intov1.xfrom
fix/6677-headers-case-sensitivity-issue

Conversation

@jasonsaayman
Copy link
Copy Markdown
Member

@jasonsaayman jasonsaayman commented Apr 9, 2026

Closes: #6677


Summary by cubic

Make axios response header types case-insensitive so both uppercase and lowercase common header keys work without TS errors. Addresses issue #6677 and aligns with AxiosHeaders behavior.

Description

  • Summary of changes
    • Added CommonResponseHeaderKey = CommonResponseHeadersList | Lowercase<CommonResponseHeadersList>.
    • Updated RawCommonResponseHeaders to use CommonResponseHeaderKey.
    • Applied the change in both index.d.ts and index.d.cts.
    • Merged v1.x formatting updates (quote normalization, condensed signatures); no runtime changes.
  • Reasoning
    • Match HTTP’s case-insensitive headers and fix TS access for keys like response.headers['content-type'].
  • Additional context

Docs

  • Clarify that common response headers can be accessed in either case (e.g., Content-Type or content-type).
  • No migration needed.

Testing

  • No tests added.
  • Recommend dtslint/TS checks to validate both response.headers['Content-Type'] and response.headers['content-type'] are accepted.

Written for commit a2bc503. Summary will update on new commits.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@jasonsaayman jasonsaayman merged commit c7a76dd into v1.x Apr 9, 2026
38 of 40 checks passed
@jasonsaayman jasonsaayman deleted the fix/6677-headers-case-sensitivity-issue branch April 9, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit::fix The PR is related to a bugfix priority::medium A medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Response headers are lowercased, types are not

1 participant