diff options
author | Brad Fitzpatrick <bradfitz@golang.org> | 2018-05-21 17:23:05 +0000 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-05-21 17:48:25 +0000 |
commit | d583ca764afc3bf5caae52f2b1361114e550a120 (patch) | |
tree | d744b6aec2988baaa5f1f8b3a8d2d96feaee1737 /src/net/http/request.go | |
parent | 64a832debe1b6bd4002430d65d9447e6e410366e (diff) | |
download | go-d583ca764afc3bf5caae52f2b1361114e550a120.tar.gz go-d583ca764afc3bf5caae52f2b1361114e550a120.zip |
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>
Diffstat (limited to 'src/net/http/request.go')
-rw-r--r-- | src/net/http/request.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/net/http/request.go b/src/net/http/request.go index 997169ce69..194b867c8c 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -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) } |