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 ignores Proto field and always uses HTTP as protocol specifier #9304

Closed
brutella opened this issue Dec 13, 2014 · 1 comment

Comments

@brutella
Copy link

I use http.Response to create packets

resp := new(http.Response)
resp.Status = "200 OK"
resp.StatusCode = http.StatusOK
resp.ProtoMajor = 1
resp.ProtoMinor = 0
resp.Proto = "EVENT/1.0"

I set the Proto field, but at the end the written bytes still contain HTTP/1.0 200 OK because that's hardcoded in response.go

@bradfitz
Copy link
Contributor

Sorry, it's true that the net/http package is an HTTP package and assumes that the thing it's speaking is HTTP.

If you want to speak a different protocol, you'll need to use or write a different package.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
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