We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
go version go1.11 linux/amd64
Yes
go env
GOARCH="amd64" GOBIN="" GOCACHE="/home/juliens/.cache/go-build" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/juliens/dev/go" GOPROXY="" GORACE="" GOROOT="/home/juliens/go-current" GOTMPDIR="" GOTOOLDIR="/home/juliens/go-current/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build305055564=/tmp/go-build -gno-record-gcc-switches"
I use the http.ReverseProxy.
I want to see all unannonced trailers in the client.
No unannonced trailers.
func TestUnannoncedTrailer(t *testing.T) { backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) w.(http.Flusher).Flush() w.Header().Set(http.TrailerPrefix+"X-Unannounced-Trailer", "unannounced_trailer_value") })) defer backend.Close() backendURL, err := url.Parse(backend.URL) if err != nil { t.Fatal(err) } proxyHandler := NewSingleHostReverseProxy(backendURL) proxyHandler.ErrorLog = log.New(ioutil.Discard, "", 0) // quiet for tests frontend := httptest.NewServer(proxyHandler) defer frontend.Close() frontendClient := frontend.Client() res, err := frontendClient.Get(frontend.URL) if err != nil { t.Fatalf("Get: %v", err) } ioutil.ReadAll(res.Body) if g, e := res.Trailer.Get("X-Unannounced-Trailer"), "unannounced_trailer_value"; g != e { t.Errorf("Trailer(X-Unannounced-Trailer) = %q ; want %q", g, e) } }
The text was updated successfully, but these errors were encountered:
Change https://golang.org/cl/151898 mentions this issue: net/http/httputil: fix announced trailers when body is empty
net/http/httputil: fix announced trailers when body is empty
Sorry, something went wrong.
48399ca
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I use the http.ReverseProxy.
What did you expect to see?
I want to see all unannonced trailers in the client.
What did you see instead?
No unannonced trailers.
More
The text was updated successfully, but these errors were encountered: