Make headers title case for backward compatibility (#6887)

## 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.
This commit is contained in:
Leiser Fernández Gallo 2024-09-03 19:28:45 +02:00 committed by GitHub
parent c667588524
commit bc7b6f109e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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))