You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggested Improvement
Remove example code which is known to be problematic in the version of Axios which is currently tagged as latest (0.18.0):
- // Alter defaults after instance has been created- instance.defaults.headers.common['Authorization'] = AUTH_TOKEN;
Relates to #1395
It would be great to replace this block with a note on how to safely set default headers on a created instance of Axios without inadvertently modifying global defaults, but at a minimum the docs shouldn't be directing users towards trouble with its code examples.
Relevant File(s):
README.md
The text was updated successfully, but these errors were encountered:
I'm also suffering this exact issue, in my case adding security Auth token to the headers is adding that to all the instances. Resulting in a security risk if I didn't notice, and making the other instances fail and send tokens where they are not supposed to be sent.
Please fix this and the related issue!
I couldn't find a way to do thing without modifying the globals. Either we can add a transform request intercepter there or there has to be another function provided in the axios instance which can do the same.
Section/Content To Improve
https://github.com/axios/axios/blob/master/README.md#custom-instance-defaults
Suggested Improvement
Remove example code which is known to be problematic in the version of Axios which is currently tagged as
latest
(0.18.0):Relates to #1395
It would be great to replace this block with a note on how to safely set default headers on a created instance of Axios without inadvertently modifying global defaults, but at a minimum the docs shouldn't be directing users towards trouble with its code examples.
Relevant File(s):
README.md
The text was updated successfully, but these errors were encountered: