requests icon indicating copy to clipboard operation
requests copied to clipboard

Normalized double slashes in digest auth URI to match request path

Open Krishna2004V opened this issue 1 month ago • 0 comments

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.

Krishna2004V avatar Nov 26 '25 04:11 Krishna2004V