Skip to content

net/http: Response.Write ignores Proto field and always uses HTTP as protocol specifier #9304

Closed
@brutella

Description

@brutella

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions