1
0
mirror of https://github.com/golang/go synced 2024-11-11 23:40:22 -07:00

net/http: note missing minor version is invalid

This commit is contained in:
Josh Deprez 2020-11-11 08:26:18 +11:00 committed by GitHub
parent 6bdab832a4
commit 5f7663ac4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -764,7 +764,8 @@ func removeZone(host string) string {
}
// ParseHTTPVersion parses an HTTP version string.
// "HTTP/1.0" returns (1, 0, true). Note that "HTTP/2" is not valid.
// "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 {