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

Refactoring of headers breaks backwards compatibility #5454

Open
Carsten-Leue opened this issue Jan 9, 2023 · 1 comment
Open

Refactoring of headers breaks backwards compatibility #5454

Carsten-Leue opened this issue Jan 9, 2023 · 1 comment

Comments

@Carsten-Leue
Copy link

Carsten-Leue commented Jan 9, 2023

Describe the bug

In this commit 7a2f901#diff-243f86a2e64131743ca04681df5d21438e79fcabe06f18029cb8dcef6a70121fR351

the type of AxiosRequestConfig got changed such that it is not longer possible to used indexed access to the headers.

error TS2551: Property 'Content-Type' does not exist on type 'AxiosHeaders | AxiosResponseHeaders | Partial<RawAxiosHeaders & MethodsHeaders & CommonHeaders> | Partial<...>'. Did you mean 'setContentType'?

const exHeader = headers['content-type'] || headers[KEY_CONTENT_TYPE];

This affects code that tried to read headers from the config

To Reproduce

config.headers['content-type']

where config is of type AxiosRequestConfig

Code snippet

No response

Expected behavior

No response

Axios Version

No response

Adapter Version

No response

Browser

No response

Browser Version

No response

Node.js Version

No response

OS

No response

Additional Library Versions

No response

Additional context/Screenshots

No response

@bobvandevijver
Copy link

Probably related to #5416.

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

No branches or pull requests

2 participants