hyperium / http

Rust HTTP types
Apache License 2.0
1.12k stars 283 forks source link

Allow mixed case header names. #593

Closed abamaxa closed 1 year ago

abamaxa commented 1 year ago

I've run into a problem with the browser installed on recent Samsung televisions where HTTP headers that are entirely lower case are not recognized, preventing the video control from working correctly.

This PR adds a new method HeaderName::from_static_preserve_case that creates a header name with the same case as the string passed to it, e.g.

HeaderName::from_static_preserve_case("Content-Range") will produce a header named Content-Range instead of content-range.

seanmonstar commented 1 year ago

The header names are purposefully lowercase in this library. It's been discussed here: #228 #377