Skip to content

Detect credentials in proxy URLs and create Proxy-authorization header - #780

Merged
yeraydiazdiaz merged 3 commits into
encode:masterfrom
yeraydiazdiaz:fix-client-proxy-auth-fails
Jan 20, 2020
Merged

yeraydiazdiaz merged 3 commits into
encode:masterfrom
yeraydiazdiaz:fix-client-proxy-auth-fails

Conversation

@yeraydiazdiaz

Copy link
Copy Markdown
Contributor

Fixes #779

Use the same logic from proxy_http in the Proxy config, e.g. detects if credentials are present in the proxy URL and adds the authorization header accordingly. Also remove the credentials for the URL.

@yeraydiazdiaz yeraydiazdiaz changed the title Detect auth in proxy URLs and create Proxy-authorization header Detect credentials in proxy URLs and create Proxy-authorization header Jan 19, 2020
Comment thread httpx/config.py Outdated

@lovelydinosaur lovelydinosaur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic stuff! One very minor implementation suggestion.

@lovelydinosaur lovelydinosaur added the bug Something isn't working label Jan 20, 2020

@lovelydinosaur lovelydinosaur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fab, love it!

@yeraydiazdiaz

Copy link
Copy Markdown
Contributor Author

Awesome, thanks!

@yeraydiazdiaz
yeraydiazdiaz merged commit b234203 into encode:master Jan 20, 2020
@yeraydiazdiaz
yeraydiazdiaz deleted the fix-client-proxy-auth-fails branch January 20, 2020 13:50
@florimondmanca florimondmanca mentioned this pull request Mar 4, 2020
3 tasks done
@lovelydinosaur lovelydinosaur mentioned this pull request Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

When using httpx.Client with proxies, authentication fails

2 participants