-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Manually set Proxy-Authorization header is always removed in 2.26 #5888
Comments
Hey @chris-sawarzynski, thanks for the report. I believe this is a byproduct of #5681. This change is now forcing a rebuild on the proxies to resolve parameters from both the Session and Request. Part of the rebuild involves stripping existing Proxy-Authorization headers and attempting to rebuild them from the url. I think this was potentially an oversight in the recent change. @sigmavirus24 I don't know if you have any thoughts about this. I'm thinking we consider this a regression, though, and it may need some follow up work to untangle the auth sanitizing from the configuration resolution. |
Yeah this part of the code is a bit of a mess frankly. We'll definitely need some careful refactoring here |
When will it be settled? |
The self-test of |
We've merged #5924 which should address this in the next minor release of Requests. I'm currently tracking for a date before EoY for the 2.27.x milestone. Resolving this for now, thanks everyone. |
In versions 2.25 it was possible to add Proxy-Authorization header manually.
Starting from requests 2.26 this header is removed from request if set manually.
When this could be a problem (real life example):
If you use requests library to programatically access service hidden behind Google Identity Aware Proxy that is protected with Basic Auth you have to provide token in Proxy-Authorization header:
https://cloud.google.com/iap/docs/authentication-howto#authenticating_from_proxy-authorization_header
Expected Result
Manually provided Proxy-Authorization header should be kept intact, or there should be an obvious way to make this work without hackng library internals
Actual Result
Proxy-Authorization header is removed from request
Reproduction Steps
System Information
This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).
The text was updated successfully, but these errors were encountered: