http-rs / http-types

Common types for HTTP operations
https://docs.rs/http-types
Apache License 2.0
200 stars 84 forks source link

panic when converting hyperium headers into http-types heades #330

Closed extraymond closed 2 years ago

extraymond commented 3 years ago

In the hyperium_http module, it will panic when inserting into the http-types's internal header's hashmap. I'm not sure what is the reason for this panic? Since it's called on a newly created Header, which guarantees having an empty header, every insert will panic.

https://github.com/http-rs/http-types/blob/bf5ace678ce5a2a3a78a5151fbed960e05a085c5/src/hyperium_http.rs#L64

yoshuawuyts commented 3 years ago

oh, odd -- that really should not be happening. Both http-types and hyperium/http only operate on ASCII strings. The only reason http-types would have to panic is if the input type is invalid ASCII. Which should not happen when converting. I'm not sure what's up.

If you have a repro, that could be really valuable!

yoshuawuyts commented 2 years ago

Unfortunately we never got this to repro. Closing until we can recreate it.