]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: note that "HTTP/2" is invalid for ParseHTTPVersion
authorJosh Deprez <DrJosh9000@users.noreply.github.com>
Tue, 10 Nov 2020 21:27:04 +0000 (21:27 +0000)
committerEmmanuel Odeke <emmanuel@orijtech.com>
Sat, 13 Mar 2021 11:26:16 +0000 (11:26 +0000)
Change-Id: Ieba05dea892ec9855a63b80e456bcf9188eef855
GitHub-Last-Rev: 5f7663ac4aaecb01a27a04309277240fd15759c9
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>

src/net/http/request.go

index 5251ebea665e8828a0ba886bf8aa6564c00482b9..aca55b1ca7b65c6af0c5e049dce5c0fd5e0c0155 100644 (file)
@@ -779,7 +779,8 @@ func removeZone(host string) 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) {
        const Big = 1000000 // arbitrary upper bound
        switch vers {