Skip to content

net/http: do not send Connection header for responses to HTTP/1.0 requests #5955

@josharian

Description

@josharian
What steps will reproduce the problem?

Run a skeleton http server locally:

http://play.golang.org/p/1YW_Kl8iYn

then

curl -0 -v localhost:6000


What is the expected output?

No Connection header in the response.


What do you see instead?

Trimmed down a bit,

$ curl -0 -v localhost:6000
> GET / HTTP/1.0
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8x
zlib/1.2.5
> Host: localhost:6000
> Accept: */*
> 
< HTTP/1.0 200 OK
< Content-Type: text/plain; charset=utf-8
< Content-Length: 0
< Connection: close
< Date: Thu, 25 Jul 2013 01:25:11 GMT
< 



Which compiler are you using (5g, 6g, 8g, gccgo)?

6g


Which operating system are you using?

OS X


Which version are you using?  (run 'go version')

1.1.1


Please provide any additional information below.

This came out of discussion at https://golang.org/issue/5950

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions