diff --git a/transport/http_util.go b/transport/http_util.go index c2bb0e53..685c6fbf 100644 --- a/transport/http_util.go +++ b/transport/http_util.go @@ -121,14 +121,19 @@ func isReservedHeader(hdr string) bool { if hdr != "" && hdr[0] == ':' { return true } - if strings.HasPrefix(hdr, "grpc-") { - return true - } switch hdr { - case "content-type", "te": + case "content-type", + "grpc-message-type", + "grpc-encoding", + "grpc-message", + "grpc-status", + "grpc-timeout", + "grpc-status-details-bin", + "te": return true + default: + return false } - return false } // isWhitelistedPseudoHeader checks whether hdr belongs to HTTP2 pseudoheaders diff --git a/transport/transport_test.go b/transport/transport_test.go index 97e63344..86104788 100644 --- a/transport/transport_test.go +++ b/transport/transport_test.go @@ -1577,7 +1577,7 @@ func TestIsReservedHeader(t *testing.T) { {"grpc-encoding", true}, {"grpc-message", true}, {"grpc-status", true}, - {"grpc-anything-else99999", true}, + {"grpc-timeout", true}, {"te", true}, } for _, tt := range tests {