Revert "Make all "grpc-" metadata field names reserved (#1391)" (#1400)
This reverts commit 3ddcdc268d88595eb2f3721f7dc87970a6c3ab6e.
diff --git a/transport/http_util.go b/transport/http_util.go
index c2bb0e5..685c6fb 100644
--- a/transport/http_util.go
+++ b/transport/http_util.go
@@ -121,14 +121,19 @@
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 97e6334..8610478 100644
--- a/transport/transport_test.go
+++ b/transport/transport_test.go
@@ -1577,7 +1577,7 @@
{"grpc-encoding", true},
{"grpc-message", true},
{"grpc-status", true},
- {"grpc-anything-else99999", true},
+ {"grpc-timeout", true},
{"te", true},
}
for _, tt := range tests {