Skip to content

chore: Add Location to CommonRequestHeadersList types#7528

Open
joaoGabriel55 wants to merge 1 commit intoaxios:v1.xfrom
joaoGabriel55:chore/upgrade-common-request-headers-list
Open

chore: Add Location to CommonRequestHeadersList types#7528
joaoGabriel55 wants to merge 1 commit intoaxios:v1.xfrom
joaoGabriel55:chore/upgrade-common-request-headers-list

Conversation

@joaoGabriel55
Copy link
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 TypeScript type for better IntelliSense and type safety in axios. Type-only change in index.d.ts and index.d.cts.

Description

  • Summary of changes
    • Added "Location" to CommonRequestHeadersList in index.d.ts and index.d.cts.
  • Reasoning
  • Additional context
    • Backward compatible; no runtime impact.

Docs

  • No docs changes. Public API is unchanged.

Testing

  • No tests added. This is a type-only change and covered by existing TypeScript checks.

Written for commit 083a29e. Summary will update on new commits.

Copy link
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

need upgrade CommonRequestHeadersList

1 participant