Skip to content

Fix URL encoding mismatch#84

Merged
carsonyl merged 2 commits intocarsonyl:masterfrom
l4u23n7p:fix/url_encoding_mismatch
Oct 11, 2025
Merged

Fix URL encoding mismatch#84
carsonyl merged 2 commits intocarsonyl:masterfrom
l4u23n7p:fix/url_encoding_mismatch

Conversation

@l4u23n7p
Copy link
Contributor

@l4u23n7p l4u23n7p commented Oct 10, 2025

Hello @carsonyl ,

Thanks for your work on this project, it has been really helpful in corporate environment.

I opened this PR to fix a bug in proxy authentication URL encoding.

PyPac uses quote_plus for encoding whereas requests uses unquote for decoding.

pypac/pypac/resolver.py

Lines 130 to 132 in 44fd400

return "{0}://{1}:{2}@{3}".format(
parsed.scheme, quote_plus(proxy_auth.username), quote_plus(proxy_auth.password), parsed.netloc
)

https://github.com/psf/requests/blob/420d16bc7ef326f7b65f90e4644adc0f6a0e1d44/src/requests/utils.py#L1017.

It leads to space ( ) character not being decoded correctly on requests side, resulting in 407 proxy error.

I would highly appreciate this fix to be merged.

Regards,

@carsonyl
Copy link
Owner

Thanks!

@carsonyl carsonyl merged commit 7f38e20 into carsonyl:master Oct 11, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants