net/http: clarify that ReadRequest is only for HTTP/1.x

Fixes #25476

Change-Id: I5a81cdf7d0ef9a22b0267732f27bcc2ef76eaa29
Reviewed-on: https://go-review.googlesource.com/113817
Reviewed-by: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
Brad Fitzpatrick 2018-05-21 17:23:05 +00:00
parent 64a832debe
commit d583ca764a
1 changed files with 5 additions and 0 deletions

View File

@ -911,6 +911,11 @@ func putTextprotoReader(r *textproto.Reader) {
}
// ReadRequest reads and parses an incoming request from b.
//
// ReadRequest is a low-level function and should only be used for
// specialized applications; most code should use the Server to read
// requests and handle them via the Handler interface. ReadRequest
// only supports HTTP/1.x requests. For HTTP/2, use golang.org/x/net/http2.
func ReadRequest(b *bufio.Reader) (*Request, error) {
return readRequest(b, deleteHostHeader)
}