Skip to content

Commit 00113fd

Browse files
committed
Fix gRPC proxying
Pass "Te" trailer. See golang/go#21096
1 parent 6a6e394 commit 00113fd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

reverse_proxy.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,10 +608,15 @@ func (p *ReverseProxy) WrappedServeHTTP(rw http.ResponseWriter, req *http.Reques
608608
// important is "Connection" because we want a persistent
609609
// connection, regardless of what the client sent to us.
610610
for _, h := range hopHeaders {
611-
if outreq.Header.Get(h) != "" {
612-
outreq.Header.Del(h)
613-
logreq.Header.Del(h)
611+
hv := outreq.Header.Get(h)
612+
if hv == "" {
613+
continue
614614
}
615+
if h == "Te" && hv == "trailers" {
616+
continue
617+
}
618+
outreq.Header.Del(h)
619+
logreq.Header.Del(h)
615620
}
616621
}
617622

0 commit comments

Comments
 (0)