-
Notifications
You must be signed in to change notification settings - Fork 909
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
Fix to contain te header in gRPC request #1965
Conversation
Motivation: According to the [spec](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests), gRPC `Request-Headers` has to conatin te header in order to detect incompatible proxies. Modification: - Add te header to gRPC request headers Result: - Fix line#1963
@@ -79,7 +80,8 @@ public UnaryGrpcClient(HttpClient httpClient) { | |||
public CompletableFuture<byte[]> execute(String uri, byte[] payload) { | |||
final HttpRequest request = HttpRequest.of( | |||
RequestHeaders.of(HttpMethod.POST, uri, | |||
HttpHeaderNames.CONTENT_TYPE, "application/grpc+proto"), | |||
HttpHeaderNames.CONTENT_TYPE, "application/grpc+proto", | |||
HttpHeaderNames.TE, HttpHeaderValues.TRAILERS), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't add a test case for this because the upstream server does not include te
header while converting request headers to MetaData
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I also found out that the upstream metadata doesn't include the pseudo headers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There's some context in grpc/grpc-java#5788 There isn't a clear definition of what headers should be in |
Codecov Report
@@ Coverage Diff @@
## master #1965 +/- ##
============================================
- Coverage 73.38% 73.34% -0.05%
+ Complexity 9103 9100 -3
============================================
Files 805 805
Lines 35474 35474
Branches 4355 4355
============================================
- Hits 26032 26017 -15
- Misses 7181 7209 +28
+ Partials 2261 2248 -13
Continue to review full report at Codecov.
|
Thanks, @minwoox ! |
Ah, thanks! Yeah, it's not defined and I think it's fine as it is. :-) |
Thanks for reviewing! |
Motivation: According to the [spec](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests), gRPC `Request-Headers` has to conatin te header in order to detect incompatible proxies. Modification: - Add te header to gRPC request headers Result: - Fix line#1963
Motivation:
According to the spec,
gRPC
Request-Headers
has to containte
header in order to detect incompatible proxies.Modification:
te
header to gRPC request headersResult: