diff --git a/internal/transport/http2_client.go b/internal/transport/http2_client.go index 27824793486e..65b4ab2439e2 100644 --- a/internal/transport/http2_client.go +++ b/internal/transport/http2_client.go @@ -1464,7 +1464,7 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { recvCompress string httpStatusErr string // the code from the grpc-status header, if present - grpcStatusCode = codes.Internal + grpcStatusCode = codes.Unknown // headerError is set if an error is encountered while parsing the headers headerError string httpStatus string diff --git a/internal/transport/transport_test.go b/internal/transport/transport_test.go index 7fc5fa0791b3..1408295f2a8f 100644 --- a/internal/transport/transport_test.go +++ b/internal/transport/transport_test.go @@ -2794,7 +2794,7 @@ func (s) TestClientDecodeTrailer(t *testing.T) { {Name: ":status", Value: "xxxx"}, }, }, - wantEndStreamStatus: status.New(codes.Internal, ""), + wantEndStreamStatus: status.New(codes.Unknown, ""), }, { name: "http2_frame_size_exceeds", @@ -2813,7 +2813,7 @@ func (s) TestClientDecodeTrailer(t *testing.T) { {Name: "content-type", Value: "application/grpc"}, }, }, - wantEndStreamStatus: status.New(codes.Internal, ""), + wantEndStreamStatus: status.New(codes.Unknown, ""), }, { name: "deadline_exceeded_status", diff --git a/test/http_header_end2end_test.go b/test/http_header_end2end_test.go index 9ad33ef3c88a..595e7d9e015e 100644 --- a/test/http_header_end2end_test.go +++ b/test/http_header_end2end_test.go @@ -169,7 +169,7 @@ func (s) TestHTTPHeaderFrameErrorHandlingNormalTrailer(t *testing.T) { // trailer missing grpc-status ":status", "502", }, - errCode: codes.Internal, + errCode: codes.Unknown, }, { name: "malformed grpc-status-details-bin field with status 404 to be ignored due to content type",