]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: clarify that ReadRequest is only for HTTP/1.x
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 21 May 2018 17:23:05 +0000 (17:23 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 21 May 2018 17:48:25 +0000 (17:48 +0000)
Fixes #25476

Change-Id: I5a81cdf7d0ef9a22b0267732f27bcc2ef76eaa29
Reviewed-on: https://go-review.googlesource.com/113817
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/net/http/request.go

index 997169ce69ec0bcb077e323f09808c070bbc24a3..194b867c8c419e67c48a8a20faa791ca11162d19 100644 (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)
 }