-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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
User-Agent overriden in Node #69
Comments
Hi friends! Anyway we could get this fix tagged in npm? We need this fix over at Vine, and I would rather not have to peg to a git commit in my package.json. Thanks :) |
+1, I could really use this fix in my project |
+1 We could really use this fix but don't want to (read: can't) fetch directly from github. |
I just released 0.6.0 which includes a fix for this. |
@mzabriskie thanks so much! |
@mzabriskie this might still be a problem when setting default headers in nodejs. For my unit tests, I have the following config:
The intent is that I don't want to modify any of my code to conditionally set the user agent. When I look at my development server, I see the following headers: { "accept": "application/json, text/plain, */*",
"user-agent": "axios/0.16.2",
"host": "localhost:3000",
"connection": "close" } |
When using axios in NodeJS, a custom set User-Agent would be overriden by Axios's default, instead of being applied if a User-Agent isn't already set.
https://github.com/mzabriskie/axios/blob/1629a026da17a1e1d8999a02f3fe6b6b60aaac9c/lib/adapters/http.js#L28-L29
The text was updated successfully, but these errors were encountered: