]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: clarify docs on Request.Proto field
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 18 Jan 2016 06:38:56 +0000 (06:38 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 18 Jan 2016 23:42:56 +0000 (23:42 +0000)
No need to say "by default" because there is no alternative and no way
to override. Always HTTP/2.0 is officially spelled HTTP/2 these days.

Fixes #13985 harder

Change-Id: Ib1ec03cec171ca865342b8e7452cd4c707d7b770
Reviewed-on: https://go-review.googlesource.com/18720
Reviewed-by: Rob Pike <r@golang.org>
src/net/http/request.go
src/net/http/transport.go

index c2f5f26a4c1db89e23c384b0af9e9080f736a8c6..16c5bb43ac4d4c7b7974dfa0c6e1c50c0c28eef3 100644 (file)
@@ -93,8 +93,8 @@ type Request struct {
        // The protocol version for incoming server requests.
        //
        // For client requests these fields are ignored. The HTTP
-       // transport code uses either HTTP/1.1 or HTTP/2.0 by default,
-       // depending on what the server supports.
+       // client code always uses either HTTP/1.1 or HTTP/2.
+       // See the docs on Transport for details.
        Proto      string // "HTTP/1.0"
        ProtoMajor int    // 1
        ProtoMinor int    // 0
index c7e6e1cfca203de18d2122c0671bfc58c8697046..fc0ae36b519d4810bb135f383216477541b02528 100644 (file)
@@ -57,6 +57,10 @@ const DefaultMaxIdleConnsPerHost = 2
 //
 // A Transport is a low-level primitive for making HTTP and HTTPS requests.
 // For high-level functionality, such as cookies and redirects, see Client.
+//
+// Transport uses HTTP/1.1 for HTTP URLs and either HTTP/1.1 or HTTP/2
+// for HTTPS URLs, depending on whether the server supports HTTP/2.
+// See the package docs for more about HTTP/2.
 type Transport struct {
        idleMu     sync.Mutex
        wantIdle   bool // user has requested to close all idle conns