Default Authorization header no longer working in 0.19.0
See original GitHub issueDescribe the bug Since axios 0.19.0, the default Authorization header is no longer set in query. It works in 0.18.X.
To Reproduce Create an axios adapter and set to it a default Authorization header, nothing is sent in the query.
axios.defaults.headers.common.Authorization = 'Bearer ANY SECURITY TOKEN';
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:15 (2 by maintainers)
Top Results From Across the Web
Unable to add Axios Default Headers to VueJS app
Since version 0.19 axios no longer uses axios.defaults if you create axios instances to make requests. Set defaults to an instance and use ......
Read more >History — Nipyapi 0.19.0 documentation - Read the Docs
Added gzip as default request header (PR from rsaggino). Update ruamel.yaml to 0.17.16. Update file read/write to explicitly handle encoding, default to ...
Read more >axios cookie header | The AI Search Engine You Control
Not Receiving Set-Cookie Header with axios post request ... getState().session.token; if (token) { axios.defaults.headers.common['Authorization'] = token; } ...
Read more >WWW-Authenticate - HTTP - MDN Web Docs
This new request uses the Authorization header to supply the credentials to the server, encoded appropriately for the selected "challenge" ...
Read more >httpx · PyPI
HTTPX is a fully featured HTTP client library for Python 3. ... does not auto-generate any headers on the request instance. (Pull #1607) ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
axios global defaults (
axios.defaults.headers
) seem to no longer affect prevoiusly-created axios client instances. Is this an intended change?Example: 0.18 - header is sent https://codesandbox.io/s/axios018-8fg9d 0.19 - header is not sent https://codesandbox.io/s/axios019-5ddn8
@glebtv this seems to in fact be intended. The documentation might need a bit of adjustment for this, I will have a look at it, however, it seems you may need to implement this:
This will change the instance defaults rather than the global default. This makes sense, especially in this example.