Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http/httputil: ReverseProxy does not pass unannounced trailers #20437

Closed
tcolgate opened this issue May 20, 2017 · 4 comments
Closed

net/http/httputil: ReverseProxy does not pass unannounced trailers #20437

tcolgate opened this issue May 20, 2017 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@tcolgate
Copy link
Contributor

What version of Go are you using (go version)?

go version devel +2d20ded584 Sat May 20 00:45:56 2017 +0000 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/tristan/src/go"
GORACE=""
GOROOT="/home/tristan/src/go"
GOTOOLDIR="/home/tristan/src/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build356611585=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

Attempt to use grpc-go via a httputil.ReverseProxy. grpc.Server does not pre-anounce its trailers. ReverseProxy only passes on pre-anounced trailers.

https://play.golang.org/p/Lt7QPq9vmX

What did you expect to see?

All trailers from upstream should be passed on

What did you see instead?

Only trailers set in the Trailer header are passed on

@gopherbot
Copy link

CL https://golang.org/cl/43712 mentions this issue.

@tcolgate
Copy link
Contributor Author

With the above patch, both helloworld and routeguide grpc-go example will work via httputil.ReverseProxy

@odeke-em
Copy link
Member

I think this might be a breaking change and that's the behavior for any handler/handlefunc
in Go and not only for httputil.ReverseProxy, unless I am mistaken.

I defer to @bradfitz for his view.

@tcolgate
Copy link
Contributor Author

The runtime has explicit support for unannounced trailers (marking the headers with the http.TraolerPrefix prefix. It would seem odd if it were expected behaviour for tReversdProxy to drop them. Perhaps I'm missing your point?

@bradfitz bradfitz added the NeedsFix The path to resolution is known, but the work has not been done. label May 20, 2017
@bradfitz bradfitz added this to the Go1.9 milestone May 22, 2017
magiconair added a commit to fabiolb/fabio that referenced this issue Jun 14, 2017
This patch enables HTTP/2 upstream connections.
With go1.9 this should also fix gRPC connections

See golang/go#20437

Fixes #244
magiconair added a commit to fabiolb/fabio that referenced this issue Jun 14, 2017
This patch enables HTTP/2 upstream connections.
With go1.9 this should also fix gRPC connections

See golang/go#20437

Fixes #244
magiconair added a commit to fabiolb/fabio that referenced this issue Jun 15, 2017
This patch enables HTTP/2 upstream connections.
With go1.9 this should also fix gRPC connections

See golang/go#20437

Fixes #244
magiconair added a commit to fabiolb/fabio that referenced this issue Feb 7, 2018
This patch enables HTTP/2 upstream connections.
With go1.9 this should also fix gRPC connections

See golang/go#20437

Fixes #244
@golang golang locked and limited conversation to collaborators May 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants