-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
No User-Agent header by default #1296
Comments
So I think it's good for us to set a user-agent. I believe the standard library sets a default as well. That said, I suspect there's a case to be made for not adding a default. Either way, I'm 👍 on adding a |
Okay! |
@haikuginger I will take a shot at this. |
Thanks, @Madhu94! Let me know if you get stuck, but I believe this should be pretty straightforward. |
I'd like to mention that there are use cases where it is undesirable to state the library version being used (since this can vary per user). I'm making a project where anonymity is important, and the fact that urllib sends the python version if no user agent is set caught me off guard a bit, and I had to manually set my own default in the wrapper function I use for network requests in case I forget to set the header when I call it. I don't have a strong opinion on the matter, but I thought I'd mention it. |
Would it be alright if I picked this issue up, taking Madhu's patch and the related code review as a starting point? |
@DonaCthulhuote It's all yours! |
Closing since #1750 was merged, even if we still need to fix #1750 (comment). |
It appears that, by default, urllib3 does not send a
User-Agent
header.By a plain reading of RFC-7231, it appears that user agents SHOULD generally set such a header unless specifically overridden or suppressed:
I couldn't find prior discussion on this, so it does seem worth talking about. Should we send a User-Agent header by default, and if so, what should it be?
CC @sigmavirus24 in particular for an opinion on the intentions of the RFC. Are we a user agent as described in the document? Or, since we expect to be used for the HTTP-level connectivity of a larger process or library, are we exempt from the requirement?
The text was updated successfully, but these errors were encountered: