hyperium / h2

HTTP 2.0 client & server implementation for Rust.
MIT License
1.34k stars 269 forks source link

Allow configurable restrictiveness for various header checks #619

Open rahulanand16nov opened 2 years ago

rahulanand16nov commented 2 years ago

We are using h2 in one of our rust services that are deployed on K8s and used in mesh with Istio. Since at the data-plane level Envoy is used, Envoy has an old behavior of passing authority header in the format of outbound|port||service-name to the service being called.

When a request from Envoy reaches our Rust service, it rejects the request due to a malformed authority header: malformed headers: malformed authority (b"outbound|8081||limitador.rahul-test.svc.cluster.local"): invalid uri character. It makes sense since | is not part of the RFC for authority header but I feel this check should be configurable depending on feature flags or something similar.

Most libraries in other languages are pretty relaxed about these checks and thus work flawlessly so I feel it's one of the areas we can improve upon in h2.