Skip to content

net/http: Response.Write has bogus Connection header after auto-ungzipped Content-Length response #15366

Closed
@sbadame

Description

@sbadame

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.6 linux/amd64
  2. What operating system and processor architecture are you using (go env)?
    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH=""
    GORACE=""
    GOROOT="/usr/lib/google-golang"
    GOTOOLDIR="/usr/lib/google-golang/pkg/tool/linux_amd64"
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -gno-record-gcc-switches -fdebug-prefix-map=/tmp/go-build052263605=/tmp/go-build"
    CXX="g++"
    CGO_ENABLED="1"
  3. What did you do?
    I can't use the playground because this requires localhost, which the playground doesn't support.
    https://gist.github.com/sbadame/6672153feb5a5430a0129d40b263d8e9
  4. What did you expect to see?
    Either "Connection: close" or "Connection:keep-alive" and a content length. Or maybe chunk encoding?
  5. What did you see instead?

http.Transport.RoundTrip response: HTTP/1.1 200 OK
Connection: close
Connection: keep-alive
Keep-Alive: timeout=7200

http.DefaultClient.Do Response: HTTP/1.1 200 OK
Connection: close
Connection: keep-alive
Keep-Alive: timeout=7200

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions