Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(TypeScript): Fix AxiosHeaders types #6696

Open
wants to merge 4 commits into
base: v1.x
Choose a base branch
from

Conversation

dwickern
Copy link

@dwickern dwickern commented Nov 9, 2024

Fixes the TypeScript definitions for AxiosHeaders:

  1. Adds Content-Encoding header as an accessor. The {get,set,has}ContentEncoding methods declared in the types and documented in the README did not actually exist at runtime and would throw an error. Now the runtime behavior matches the types.
  2. Adds missing types for the {get,set,has}AcceptEncoding methods created by the Accept-Encoding accessor
  3. Fixes return type of the no-arg overload for get accessors. For example, headers.getContentType() returns the value of the content-type header. The return type was incorrectly declared as RegExpExecArray | null when not passing a RegExp.

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.

1 participant