This reverts commit 3ddcdc268d88595eb2f3721f7dc87970a6c3ab6e.
This commit is contained in:
@ -121,15 +121,20 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
// isWhitelistedPseudoHeader checks whether hdr belongs to HTTP2 pseudoheaders
|
||||
// that should be propagated into metadata visible to users.
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user