encode/httpcore

non basic Proxy Authorization requests blocked by http_proxy raising error

pettzilla1 opened this issue · 1 comments

if connect_response.status < 200 or connect_response.status > 299:

The line filtering out status codes above 299 is overly restrictive as it filters out 407 and 401 requests which are requests for additional information for authorization,
I have tested a fix for this myself by adding to the line prior

if connect_response.status in(407,401): return( connect_response)
this will allow the request for proxy authorization to be returned and followed up upon appropriately by the user.

I'm happy to write a pull request to action this update if there is capacity to review

Raising a ProxyError in response to a 407 is a reasonable behavior here.

Related... could contributors please start with discussions first...

image

...that allows us as a team to reserve "issues" for work that we've determined to be actionable & desired.