Skip to content

Fix #1623: Decode percent-encoded characters in URL credentials - #1931

Open
vinayK34 wants to merge 1 commit into
httpie:masterfrom
vinayK34:fix/issue-1623-percent-encoded-credentials
Open

Fix #1623: Decode percent-encoded characters in URL credentials#1931
vinayK34 wants to merge 1 commit into
httpie:masterfrom
vinayK34:fix/issue-1623-percent-encoded-credentials

Conversation

@vinayK34

Copy link
Copy Markdown

This fixes the issue where username/password in URLs were not being decoded before authentication.

For example, a URL like https://u%40d:***@httpbin.org/basic-auth/u%40d/1%3d2%3f would use the literal encoded values instead of decoding them to 'u@d' and '1=2?'.

The fix adds decoding of percent-encoded characters in both username and password when they are extracted from URLs in the _process_auth method.

This fixes the issue where username/password in URLs were not being
decoded before authentication. For example, a URL like
'https://u%40d:***@httpbin.org/basic-auth/u%40d/1%3d2%3f' would use
the literal encoded values instead of decoding them to 'u@d' and '1=2?'.

The fix adds decoding of percent-encoded characters in both username
and password when they are extracted from URLs in the _process_auth method.
@vinayK34
vinayK34 marked this pull request as ready for review August 11, 2026 13:15
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.

1 participant