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

fix misleading documentation for request.Host #72096

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/net/http/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,8 @@ type Request struct {
// empty. (See RFC 7230, Section 5.3)
//
// For client requests, the URL's Host specifies the server to
// connect to, while the Request's Host field optionally
// specifies the Host header value to send in the HTTP
// request.
// connect to, while the Request's Host field specifies the
// Host header value to send in the HTTP request.
URL *url.URL

// The protocol version for incoming server requests.
Expand Down Expand Up @@ -598,7 +597,7 @@ func (r *Request) write(w io.Writer, usingProxy bool, extraHeaders Header, waitF
}
}()

// Find the target host. Prefer the Host: header, but if that
// Find the target host. Prefer the Host field, but if that
// is not given, use the host from the request URL.
//
// Clean the host, in case it arrives with unexpected stuff in it.
Expand Down