-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Envoy doesn't clear TE header #5541
Comments
RFC2616 is obsoleted. From RFC7230, sec. 4.3:
and:
In theory, On the other hand, Envoy, when acting as a client, accepts trailers, so it should emit it's own Furthermore, removing |
Envoy does HTTP/1.1 trailers? I think unsupported 1.1 trailers was our (original) motivation for stripping TE as it was one of the few actual uses. |
Doesn't it? Sorry, I actually don't know, but I assumed it does, since they are part of chunked encoding, and Envoy as a whole is aware of trailers. Regardless, as far as I can tell, you change removes |
Envoy sure supports trailers for H2, but if you attempt to send trailers with an H1 codec it doesn't actually encode them and if we get them in we explicitly drop them on the floor** so I think stripping TE: trailers for HTTP/1.1 makes sense. By the H2 spec the only legal value of TE is "trailers", so we could theoretically pass that through coming from H2 and going to H2 (basically strip incoming and outgoing in the HTTP/1.1 codec). *https://github.com/envoyproxy/envoy/blob/master/source/common/http/http1/codec_impl.cc#L156 |
My memory is a bit fuzzy at this point, but I'm pretty sure that gRPC requires I don't see this being explicitly called out in the spec, but grpc/PROTOCOL-HTTP2.md says:
and official clients are definitely sending Also, from https://nghttp2.org/blog/2015/03/24/proxying-grpc-with-nghttpx/:
So we pretty much need to forward |
OK, so the most correct thing to do would be to clear "trailers" from TE for HTTP/1.1 and leave the rest intact? Given prior experiences clearing individual fields from hop by hop headers causing avoidable perf issues I think I'm going to steer away, and either file this as a proxy difference, implement the aggressive in-house clearing, or suggest we upgrade the in-house sanitization to something more modern. |
Is my issue related? |
Per the RFC https://tools.ietf.org/html/rfc2616#section-13.5.1 this should be hop by hop.
I'll throw together a quick PR to clear it in mutateRequestHeaders - just filing a tracking issue for internal accounting.
The text was updated successfully, but these errors were encountered: