Skip to content

Fixed URL-encoded characters in basic auth credentials (#1623) - #1936

Open
abhishekjoshi13 wants to merge 2 commits into
httpie:masterfrom
abhishekjoshi13:fix-auth-url-decode
Open

Fixed URL-encoded characters in basic auth credentials (#1623)#1936
abhishekjoshi13 wants to merge 2 commits into
httpie:masterfrom
abhishekjoshi13:fix-auth-url-decode

Conversation

@abhishekjoshi13

Copy link
Copy Markdown

When providing credentials in the URL that contain URL-encoded characters (like %40 for @), the urlsplit output was not being decoded before being passed to AuthCredentials. This resulted in the raw encoded string being Base64 encoded, causing server rejection. I injected urllib.parse.unquote in argparser.py to decode url.username and url.password prior to generating the Basic Auth headers

@abhishekjoshi13

Copy link
Copy Markdown
Author

HI team, just a quick heads up. The fix for decoding credentials in the URL is pushed and ready for review. I noticed the CI pipeline is throwing some failures, but after reviewing the server logs, they appear to be unrelated upstream issues:

  1. test_cli_ui.py::test_naked_invocation - Failing on python 3.12 due to the argparse formatting changes(quotes being added around choices)
  2. test_encoding.py - The big5 charset tests appear to be failing across environments.
    Let me know if you would like me to write a dedicated unit test for this URL decoding fix, or if there is anything else you need from me to get this merged.

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