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 · 6 comments

Comments

Projects
None yet
4 participants
@conspicuousClockwork
Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

commented Jul 11, 2018

Not from me, no.

@conspicuousClockwork

This comment has been minimized.

Copy link
Contributor Author

commented Jul 11, 2018

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

@cjerdonek

This comment has been minimized.

Copy link
Member

commented Mar 31, 2019

Addressed by PR #5550 / ac9010e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.