Skip to content

chore: Add Location to CommonRequestHeadersList types#7528

Merged
jasonsaayman merged 3 commits intoaxios:v1.xfrom
joaoGabriel55:chore/upgrade-common-request-headers-list
Apr 7, 2026
Merged

chore: Add Location to CommonRequestHeadersList types#7528
jasonsaayman merged 3 commits intoaxios:v1.xfrom
joaoGabriel55:chore/upgrade-common-request-headers-list

Conversation

@joaoGabriel55
Copy link
Copy Markdown
Contributor

@joaoGabriel55 joaoGabriel55 commented Mar 18, 2026

Summary

Fixes #7527

Adds the Location header to the CommonRequestHeadersList TypeScript type in both index.d.ts and index.d.cts. Based on the MDN Headers docs: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers#redirects

Motivation

The Location header is a commonly used HTTP header (e.g., in redirect responses and certain request scenarios), but it was missing from the CommonRequestHeadersList union type. This meant that accessing or setting the Location header through Axios's typed header APIs did not benefit from type-safe autocompletion or validation.

Changes

  • index.d.ts — Added "Location" to the CommonRequestHeadersList union type.
  • index.d.cts — Added 'Location' to the CommonRequestHeadersList union type (CJS types).

Checklist

  • Both .d.ts and .d.cts type files updated consistently
  • No runtime behavior changes
  • Backward compatible — existing code is unaffected

Summary by cubic

Adds the Location header to the CommonRequestHeadersList type to improve IntelliSense and type safety in axios. Type-only update in index.d.ts and index.d.cts, rebased on latest v1.x.

Description

Testing

  • No tests added. Type-only change covered by existing TypeScript checks.

Written for commit 39dae90. 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.

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

@jasonsaayman jasonsaayman added priority::medium A medium priority commit::chore The PR is related to a chore labels Apr 7, 2026
@jasonsaayman jasonsaayman self-requested a review April 7, 2026 17:29
@jasonsaayman jasonsaayman added commit::fix The PR is related to a bugfix and removed commit::chore The PR is related to a chore labels Apr 7, 2026
@jasonsaayman jasonsaayman merged commit 9df2cd3 into axios:v1.x Apr 7, 2026
22 checks passed
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.

need upgrade CommonRequestHeadersList

2 participants