net/http/httputil: ReverseProxy is not allowing to change the status message for the response #39415
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Have not upgraded to latest version yet
What operating system and processor architecture are you using (
go env
)?set GO111MODULE=
set GOARCH=amd64
set GOBIN=C:\Users\xyz\Documents\GitHub\Go\workspace\bin
set GOCACHE=C:\Users\xyz\AppData\Local\go-build
set GOENV=C:\Users\xyz\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\xyz\Documents\GitHub\Go\workspace
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\xyz\Documents\GitHub\integration-gateway\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\xyz\AppData\Local\Temp\go-build906736114=/tmp/go-build -gno-record-gcc-switches
go env
OutputWhat did you do?
Overwrote the ModifyResponse method in Reversproxy and set the status of Response to a custom value. In addition to that changed the status code of the response as well
resp.StatusCode = 201
resp.Status = "Custom object created"
What did you expect to see?
Expected to see the status-code as well as the status message to change in the final response
What did you see instead?
Only the status code was changed, but the status message was never changed.
The text was updated successfully, but these errors were encountered: