Skip to content

net/http: should Request.Write use Header["Host"] if Request.Host is unset? #4792

@bradfitz

Description

@bradfitz
See:
http://play.golang.org/p/toLUTjj_fE

The Host field is not written, since Request.Write(io.Writer) uses Request.Host, and not
Request.Header.Get("Host").

It's document that Request.Write uses the Host field, and it's listed first:

    http://golang.org/pkg/net/http/#Request.Write

Should Request.Write fall back to Request.Header.Get("Host") if Request.Host
is unset?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions