Skip to content

Commit

Permalink
Make headers title case for backward compatibility (#6887)
Browse files Browse the repository at this point in the history
## Summary
Http headers are supposed to be case-insensitive (RFC 2616), but there
are some implementations that don't normalize them.
I noticed it while migrating to `uv`, calls to an internal registry
failed. A man in the middle server helped me to find that `pip` uses
Title-Case while `uv pip` uses lowercase.

## Test Plan

I tested `uv` with the same server and now it works fine.
  • Loading branch information
leiserfg authored Sep 3, 2024
1 parent c667588 commit bc7b6f1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/uv-client/src/base_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ impl<'a> BaseClientBuilder<'a> {
) -> Client {
// Configure the builder.
let client_builder = ClientBuilder::new()
.http1_title_case_headers()
.user_agent(user_agent)
.pool_max_idle_per_host(20)
.read_timeout(std::time::Duration::from_secs(timeout))
Expand Down

0 comments on commit bc7b6f1

Please sign in to comment.