ITADN

Headers with empty value are not parsed correctly

#889Closeddotansimha 创建于 2026-05-18
D
dotansimhacommented
I'm investigating an issue in `hive-router`: https://github.com/graphql-hive/router/issues/997 With ntex 3.7.2 (our current locked version), it works perfectly fine. With latest ntex 3.9.5, it seems like header parsing had a regression in the way that empty headers are parsed. To experiment with this, I tried to just print the headers like that: ```rust println("headers: {:?}", req.headers()); ``` And send a request where a header value is empty: ``` My-Header: "" ``` This leads to the header being parsed as `"My-Header": "My-Header \xd\xa"`. When trying to use that header later, it panic due to an invalid value, and panics because [this](https://github.com/ntex-rs/ntex/blob/main/ntex-http/src/value.rs#L491) shouldn't really ever happen. Was there any change between these versions that could have cause this?
关闭于 2026-05-19 1 条评论