]> Cypherpunks repositories - gostls13.git/commitdiff
http: clarify docs on Request HTTP version
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 22 Apr 2011 02:57:19 +0000 (19:57 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 22 Apr 2011 02:57:19 +0000 (19:57 -0700)
Fixes #910

R=adg, rsc1
CC=golang-dev
https://golang.org/cl/4439062

src/pkg/http/dump.go
src/pkg/http/request.go

index 306c45bc2c9398c9281aadc9eb8aec0d94fd56ad..358980f7cae46798de0032cea92747dfb76011c7 100644 (file)
@@ -31,6 +31,8 @@ func drainBody(b io.ReadCloser) (r1, r2 io.ReadCloser, err os.Error) {
 // DumpRequest is semantically a no-op, but in order to
 // dump the body, it reads the body data into memory and
 // changes req.Body to refer to the in-memory copy.
+// The documentation for Request.Write details which fields
+// of req are used.
 func DumpRequest(req *Request, body bool) (dump []byte, err os.Error) {
        var b bytes.Buffer
        save := req.Body
index 633c91e8d20ccd6188a89c87a96fad5c108f8947..26039cb623e33553bb5dae2572aef472e5f18287 100644 (file)
@@ -64,9 +64,12 @@ var reqExcludeHeader = map[string]bool{
 
 // A Request represents a parsed HTTP request header.
 type Request struct {
-       Method     string // GET, POST, PUT, etc.
-       RawURL     string // The raw URL given in the request.
-       URL        *URL   // Parsed URL.
+       Method string // GET, POST, PUT, etc.
+       RawURL string // The raw URL given in the request.
+       URL    *URL   // Parsed URL.
+
+       // The protocol version for incoming requests.
+       // Outgoing requests always use HTTP/1.1.
        Proto      string // "HTTP/1.0"
        ProtoMajor int    // 1
        ProtoMinor int    // 0