Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: Response.Write repeats status code #3636

Closed
gopherbot opened this issue May 17, 2012 · 2 comments
Closed

net/http: Response.Write repeats status code #3636

gopherbot opened this issue May 17, 2012 · 2 comments

Comments

@gopherbot
Copy link

by bronze1man:

What steps will reproduce the problem?
run following program
package main
import(
"net/http"
"os"
"fmt"
)
func main(){
    resp,err := http.Get("http://www.google.com/1/";)
    if (err!=nil){
        fmt.Println(err)
        return
    }
    w:=os.Stdout
    resp.Write(w)
}


What is the expected output?
HTTP/1.0 404 Not Found
Connection: close
Content-Length: 933
....


What do you see instead?
HTTP/1.0 404 404 Not Found
Connection: close
Content-Length: 933


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

Which operating system are you using?
ubuntu 12.04 x386

Which version are you using?  (run 'go version')
go version go1.0.1

Please provide any additional information below.
@rsc
Copy link
Contributor

rsc commented May 17, 2012

Comment 1:

Nice.

Owner changed to @bradfitz.

Status changed to Accepted.

@bradfitz
Copy link
Contributor

Comment 3:

This issue was closed by revision d45f22e.

Status changed to Fixed.

bradfitz added a commit that referenced this issue May 11, 2015
…Write

««« backport aad801637707
net/http: fix duplicate status code in Response.Write

Fixes #3636

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6203094

»»»
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants