rust-http2 icon indicating copy to clipboard operation
rust-http2 copied to clipboard

Server example is broken with ETag header

Open skligys opened this issue 7 years ago • 3 comments
trafficstars

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.

skligys avatar May 20 '18 17:05 skligys

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.

stepancheg avatar May 20 '18 20:05 stepancheg

BTW, for debugging it's useful to execute with RUST_LOG=httpbis=debug, which prints something useful sometimes.

stepancheg avatar May 20 '18 20:05 stepancheg

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.

skligys avatar May 22 '18 00:05 skligys