net/http: note that "HTTP/2" is invalid for ParseHTTPVersion

Change-Id: Ieba05dea892ec9855a63b80e456bcf9188eef855
GitHub-Last-Rev: 5f7663ac4a
GitHub-Pull-Request: golang/go#41806
Reviewed-on: https://go-review.googlesource.com/c/go/+/259758
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Trust: Damien Neil <dneil@google.com>
This commit is contained in:
Josh Deprez 2020-11-10 21:27:04 +00:00 committed by Emmanuel Odeke
parent a8a85281ca
commit 59e012991a

View file

@ -779,7 +779,8 @@ func removeZone(host string) string {
} }
// ParseHTTPVersion parses an HTTP version string. // ParseHTTPVersion parses an HTTP version string.
// "HTTP/1.0" returns (1, 0, true). // "HTTP/1.0" returns (1, 0, true). Note that strings without
// a minor version, such as "HTTP/2", are not valid.
func ParseHTTPVersion(vers string) (major, minor int, ok bool) { func ParseHTTPVersion(vers string) (major, minor int, ok bool) {
const Big = 1000000 // arbitrary upper bound const Big = 1000000 // arbitrary upper bound
switch vers { switch vers {