Skip to content

Conversation

Sklyvan
Copy link

@Sklyvan Sklyvan commented Dec 3, 2024

Fixes #6102

Update HTTPDigestAuth to handle non-latin credentials correctly.

  • Change _basic_auth_str in src/requests/auth.py to encode username and password using utf-8 instead of latin1.
  • Update build_digest_header in src/requests/auth.py to correctly format the string for the header with non-latin characters.
  • Add tests in tests/test_requests.py to verify correct handling of non-latin credentials in HTTPDigestAuth.

Fixes #6102

Update `HTTPDigestAuth` to handle non-latin credentials correctly.

* Change `_basic_auth_str` in `src/requests/auth.py` to encode `username` and `password` using `utf-8` instead of `latin1`.
* Update `build_digest_header` in `src/requests/auth.py` to correctly format the string for the header with non-latin characters.
* Add tests in `tests/test_requests.py` to verify correct handling of non-latin credentials in `HTTPDigestAuth`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/psf/requests/issues/6102?shareId=XXXX-XXXX-XXXX-XXXX).
@sigmavirus24
Copy link
Contributor

I think #6772 is the correct way to fix this

@Sklyvan Sklyvan closed this by deleting the head repository Dec 6, 2024
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.

HTTPDigestAuth fails on non-latin credentials

2 participants