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

Ability for user to insert provisional User-Agent string #5549

Closed
conspicuousClockwork opened this issue Jun 28, 2018 · 7 comments
Closed

Ability for user to insert provisional User-Agent string #5549

conspicuousClockwork opened this issue Jun 28, 2018 · 7 comments

Comments

@conspicuousClockwork
Copy link
Contributor

@conspicuousClockwork conspicuousClockwork commented Jun 28, 2018

What's the problem this feature will solve?
Some end users have a specific need to modify the User-Agent header. As per issue #5424, direct overwriting is a drastic measure, so instead, this is a request to add provisional data to the JSON appended to the header by default.

Describe the solution you'd like
Usage of the environment variable PIP_USER_AGENT_PROVISIONAL_STRING to insert data into the JSON appended onto the default User-Agent header.

This will allow users who are required to include specific information in the User-Agent headers sent out (such as through a proxy) and will allow users to implement their own tracking on Pip requests as well.

Alternative Solutions
Currently the only alternative solution is to modify download.py by hand to include a custom value to the User-Agent header.

Additional context
This is similar to #5424, however, that issue veered towards support for wrappers. This issue is focused on providing this functionality to end users while allowing for the eventual support of wrapper specific variables.

@pfmoore
Copy link
Member

@pfmoore pfmoore commented Jun 28, 2018

Currently the only alternative solution is to modify download.py by hand to include a custom value to the User-Agent header.

One other alternative solution (I'm not saying it's necessarily a good one, just mentioning it as an option) would be to run a local proxy on your PC that injected the extra header information while forwarding the traffic to the original destination.

@conspicuousClockwork
Copy link
Contributor Author

@conspicuousClockwork conspicuousClockwork commented Jun 28, 2018

@pfmoore true, although several other package management utilities include this functionality so there seems to be a precedent for having it. I'm about to create a pull request for this, and it didn't require too much modification to be honest.

@conspicuousClockwork
Copy link
Contributor Author

@conspicuousClockwork conspicuousClockwork commented Jul 11, 2018

@pfmoore any more thoughts on this? The original discussion surrounding the user agent header was intended for wrappers, so I'm not entirely sure if the suggestion of a complete override was scrapped because it was for the purpose of a wrapper or not.

A few other utilities allow for the complete overriding of the user-agent string, but if there are concerns about that it is completely understandable. I'm just trying to get this functionality for my team, since we are all affected by a lack of a way to authenticate properly through our proxy. Thanks!

@pfmoore
Copy link
Member

@pfmoore pfmoore commented Jul 11, 2018

Not from me, no.

@conspicuousClockwork
Copy link
Contributor Author

@conspicuousClockwork conspicuousClockwork commented Jul 11, 2018

Ah, okay. I'll wait for other members to review this issue and PR then. Thanks for the input!

@cjerdonek
Copy link
Member

@cjerdonek cjerdonek commented Mar 31, 2019

Addressed by PR #5550 / ac9010e.

@lock
Copy link

@lock lock bot commented May 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the S: auto-locked label May 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators May 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants