akka / akka-http

The Streaming-first HTTP server/module of Akka
https://doc.akka.io/libraries/akka-http/current/
Other
1.34k stars 594 forks source link

Http2: Optimize HPACK header encoding for high entropy headers #2892

Open jrudolph opened 4 years ago

jrudolph commented 4 years ago

As @surendarchandra noticed, our HPACK header tries to encode as many header values as possible into dynamic table entries. The effect can be that high entropy headers like Date or Content-Length evict more useful headers from the dynamic table.

The HPACK implementation from twitter that we use, allows to pass the sensitive flag to encodeHeader which prevents that the values are put into the dynamic table. We should consider to encode high entropy header using the sensitive flag for better use of the dynamic header table.

zhxiaogg commented 4 years ago

I think this is a problem that should be fixed from HPACK, it has been pointed out here: https://github.com/twitter/hpack/issues/34

For sensitive flag, it's considered to be used to protect valuable or sensitive values such as the Cookie or Authorization headers, see https://httpwg.org/specs/rfc7541#rfc.section.7.1.3 . It's the implementations choice to set some header as sensitive by default though.

Overall, I think this issue is blocked by : https://github.com/akka/akka-http/issues/304, since seems like HPACK has officially retired.