Skip to content

net/http: Transfer-Encoding header is missing in headers (http.Request) #27061

@subbu05

Description

@subbu05

Transfer-Encoding header is missing when http.Request.Header is printed/accessed.

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

go version go1.10.3 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

GOARCH="amd64"
GOBIN="/Users/user/go/bin"
GOCACHE="/Users/sumalepa/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="linux"
GOPATH="/Users/user/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.3/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="0"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/76/trlnwqwj0bs5003x850kzpg00000gn/T/go-build494326801=/tmp/go-build -gno-record-gcc-switches"

What did you do?

We have a nginx server that routes the requests to go based http server.

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

What did you expect to see?

We expected to see the header Transfer-Encoding

What did you see instead?

Missing header Transfer-Encoding

Few Details:
Http-Client (User-Agent [Go-http-client/1.1]) -> Nginx -> Http server (Go based server)
Sent a PUT request from client with chunked encoding header to nginx in turn nginx sends the request to http server.
I was able to see the headers in the pcap dumps captured at client, nginx. But on go http server I didn't the header.

But in the go http server output I didn't see the Transfer-Encoding header.
As a part of debug process I replaces go http server with python http server. I was able to see the Transfer-Encoding header on http python server.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions