From d583ca764afc3bf5caae52f2b1361114e550a120 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 21 May 2018 17:23:05 +0000 Subject: [PATCH] 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 --- src/net/http/request.go | 5 +++++ 1 file changed, 5 insertions(+) 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) } -- 2.50.0