rust-http2
rust-http2 copied to clipboard
Server example is broken with ETag header
The example at examples/server.rs breaks when I add one more header after line 36, https://github.com/stepancheg/rust-http2/blob/master/examples/server.rs#L36 :
resp_headers.add("ETag", "12345678901234567890");
Tested with Firefox 60.0.1 and Google Chrome 65.0, in both cases no response comes back with the above line added to the server example. Tried to debug but got all lost in futures.
I'm not sure, but probably that's because HTTP/2 headers must be lower case (etag, not ETag). If it's the case rust-protobuf should probably automatically convert names to lower case.
BTW, for debugging it's useful to execute with RUST_LOG=httpbis=debug, which prints something useful sometimes.
Thanks for suggestions. RUST_LOG=httpbis=debug did not print anything but changing "ETag" into "etag" fixed the hang.
Would be nice to either loudly fail or automatically map non-lowercase header names into lowercase.