Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/transport/http2_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -1485,7 +1485,7 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) {
case "grpc-status":
code, err := strconv.ParseInt(hf.Value, 10, 32)
if err != nil {
se := status.New(codes.Internal, fmt.Sprintf("transport: malformed grpc-status: %v", err))
se := status.New(codes.Unknown, fmt.Sprintf("transport: malformed grpc-status: %v", err))
t.closeStream(s, se.Err(), true, http2.ErrCodeProtocol, se, nil, endStream)
return
}
Expand Down
8 changes: 4 additions & 4 deletions internal/transport/transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2681,7 +2681,7 @@ func (s) TestClientDecodeHeader(t *testing.T) {
},
},
wantStatus: status.New(
codes.Internal,
codes.Unknown,
"transport: malformed grpc-status: strconv.ParseInt: parsing \"xxxx\": invalid syntax",
),
},
Expand Down Expand Up @@ -2813,7 +2813,7 @@ func (s) TestClientDecodeTrailer(t *testing.T) {
},
},
wantEndStreamStatus: status.New(
codes.Internal,
codes.Unknown,
"transport: malformed grpc-status: strconv.ParseInt: parsing \"xxxx\": invalid syntax",
),
},
Expand All @@ -2824,7 +2824,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",
Expand All @@ -2843,7 +2843,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",
Expand Down
4 changes: 2 additions & 2 deletions test/http_header_end2end_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (s) TestHTTPHeaderFrameErrorHandlingInitialHeader(t *testing.T) {
"content-type", "application/grpc",
"grpc-status", "abc",
},
errCode: codes.Internal,
errCode: codes.Unknown,
},
{
name: "Malformed grpc-tags-bin field ignores http status",
Expand Down Expand Up @@ -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",
Expand Down
Loading