]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: document Request.URL
authorRick Arnold <rickarnoldjr@gmail.com>
Wed, 2 Jan 2013 22:37:27 +0000 (17:37 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 2 Jan 2013 22:37:27 +0000 (17:37 -0500)
Request.URL had no documentation before and some people were expecting all fields to be populated.

Fixes #3805.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7008046

src/pkg/net/http/request.go

index 0b6e6cbab58697eaab8441bb27a5d29735ae919f..f50e254fb28ce2ce7fcc5d5fa1976609fa5e9375 100644 (file)
@@ -71,7 +71,13 @@ var reqWriteExcludeHeader = map[string]bool{
 // or to be sent by a client.
 type Request struct {
        Method string // GET, POST, PUT, etc.
-       URL    *url.URL
+
+       // URL is created from the URI supplied on the Request-Line
+       // as stored in RequestURI.
+       //
+       // For most requests, fields other than Path and RawQuery
+       // will be empty. (See RFC 2616, Section 5.1.2)
+       URL *url.URL
 
        // The protocol version for incoming requests.
        // Outgoing requests always use HTTP/1.1.