]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: document that Request.Host includes HTTP/2 :authority
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 2 Oct 2019 16:34:03 +0000 (16:34 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 2 Oct 2019 16:47:29 +0000 (16:47 +0000)
Fixes #34640

Change-Id: I4a6c9414fe369cd5e9915472331c4bd8a21d8b0e
Reviewed-on: https://go-review.googlesource.com/c/go/+/198457
Reviewed-by: Filippo Valsorda <filippo@golang.org>
src/net/http/request.go

index 0b195a89a67880d0c0b3581b7f6be227ead21f54..1fdd8a4fc7055c16861019931089cdc4a2c0a2aa 100644 (file)
@@ -217,9 +217,11 @@ type Request struct {
        // Transport.DisableKeepAlives were set.
        Close bool
 
-       // For server requests, Host specifies the host on which the URL
-       // is sought. Per RFC 7230, section 5.4, this is either the value
-       // of the "Host" header or the host name given in the URL itself.
+       // For server requests, Host specifies the host on which the
+       // URL is sought. For HTTP/1 (per RFC 7230, section 5.4), this
+       // is either the value of the "Host" header or the host name
+       // given in the URL itself. For HTTP/2, it is the value of the
+       // ":authority" pseudo-header field.
        // It may be of the form "host:port". For international domain
        // names, Host may be in Punycode or Unicode form. Use
        // golang.org/x/net/idna to convert it to either format if