Skip to content

net/http: document NoBody change in release notes #18257

@jasdel

Description

@jasdel

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

1.8beta1 and devel +2912544

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

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

What did you do?

Make HTTP request with Go 1.8beta1 and Go tip with a zero length HTTP request body.

What did you expect to see?

GET http://route53.amazonaws.com/2013-04-01/hostedzone HTTP/1.1
Host: route53.amazonaws.com
User-Agent: aws-sdk-go/1.6.1 (go1.7.4; darwin; amd64)
Accept-Encoding: gzip

What did you see instead?

GET http://route53.amazonaws.com/2013-04-01/hostedzone HTTP/1.1
Host: route53.amazonaws.com
User-Agent: aws-sdk-go/1.6.1 (go1.8beta1; darwin; amd64)
Transfer-Encoding: chunked
Accept-Encoding: gzip

0

In aws/aws-sdk-go#984 it was discovered that Go 1.8beta1 and tip will send HTTP requests with Transfer-Ecoding: chunked if the request's body is zero length. This seems to be confusing some web servers that are waiting on content from the client. Eventually the the socket is closed by the server.

I think this is related to a HTTP server waiting for the last-chunk value. I have a feeling that the request content encoded body should be sent as, but not familiar with transfer-encoding spec to have a definitive suggesting.

0  <- chunk-size
0  <- last-chunk

https://tools.ietf.org/html/rfc2616#page-25

With that said, it would be preferable for the previous functionality preserved where transfer-encoding is only used for non-zero length bodies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.NeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions