Skip to content

Conversation

@Krishna2004V
Copy link

Fixes #6784

Summary

  • Normalizes double slashes in digest auth URI to match the request path normalization done in HTTPAdapter.request_url().

Changes

  • Added path normalization in build_digest_header() in src/requests/auth.py
  • Added regression test test_DIGEST_AUTH_NORMALIZES_DOUBLE_SLASH_PATH

Problem

  • When a URL contains double slashes (e.g., http://example.com//path), the actual HTTP request path gets normalized to /path, but the digest auth header was using //path. This mismatch caused authentication failures (400 Bad Request).

Solution

  • Apply the same normalization to the path used in digest auth headers.

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.

Multiple path separators causes bad requests

1 participant