Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of non-latin credentials in HTTPDigestAuth #6837

Closed
wants to merge 1 commit into from
Closed

Fix handling of non-latin credentials in HTTPDigestAuth #6837

wants to merge 1 commit into from

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