Grpc transcoding: set content-type to json for tailer-only#8158
Grpc transcoding: set content-type to json for tailer-only#8158qiwzhang wants to merge 3 commits intoenvoyproxy:masterfrom
Conversation
Signed-off-by: Wayne Zhang <qiwzhang@google.com>
| const absl::optional<Grpc::Status::GrpcStatus> grpc_status = | ||
| Grpc::Common::getGrpcStatus(trailers); | ||
| if (!grpc_status || grpc_status.value() == Grpc::Status::GrpcStatus::InvalidCode) { | ||
| response_headers_->Status()->value(enumToInt(Http::Code::ServiceUnavailable)); |
There was a problem hiding this comment.
if upstream doesn't return grpc-status, it usually means the HTTP status is not 200 (5xx etc), in that case shall we override the HTTP status?
There was a problem hiding this comment.
Updated, not to set Status() if upstream grpc-status is not available.
There was a problem hiding this comment.
There should be if (!grpc_status) { return; } before this if (grpc_status.value() == ...).
There was a problem hiding this comment.
Done. Thanks for catching this crash.
|
|
||
| if (end_stream) { | ||
| // In gRPC wire protocol, headers frame with end_stream is a trailers-only response. | ||
| // The return value from encodeTrailers is ignored since it is always continue. |
|
cc @ascheglov |
Signed-off-by: Wayne Zhang <qiwzhang@google.com>
Signed-off-by: Wayne Zhang <qiwzhang@google.com>
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
I have been asked to take over this change. I will make another PR rebased off #8009 |
…e that the returned content type is `application/json`. This is required because the response body is an empty JSON body by default. Risk Level: Low Testing: Modified integration test to catch this bug. Docs Changes: None Release Notes: None Fixes: envoyproxy#5011 Ref: envoyproxy#8158 Ref: envoyproxy#8009 Signed-off-by: Teju Nareddy <nareddyt@google.com>
* When trailer indicates a gRPC error and there was no HTTP body, ensure that the returned content type is `application/json`. This is required because the response body is an empty JSON body by default. Risk Level: Low Testing: Modified integration test to catch this bug. Docs Changes: None Release Notes: None Fixes: #5011 Ref: #8158 Ref: #8009 Signed-off-by: Teju Nareddy <nareddyt@google.com>
…oxy#8312) * When trailer indicates a gRPC error and there was no HTTP body, ensure that the returned content type is `application/json`. This is required because the response body is an empty JSON body by default. Risk Level: Low Testing: Modified integration test to catch this bug. Docs Changes: None Release Notes: None Fixes: envoyproxy#5011 Ref: envoyproxy#8158 Ref: envoyproxy#8009 Signed-off-by: Teju Nareddy <nareddyt@google.com>
Signed-off-by: Wayne Zhang qiwzhang@google.com
Description:
Set the content-type as application/json for tailer only response.
Risk Level: Low
Testing: integration test.
Fixes #5011