Commit 15c62e85 authored by Sameer Ajmani's avatar Sameer Ajmani

net/http: document Response.Header values that are subordinate to other fields

I noticed that Content-Length may appear in http.Response.Header, but the docs
say it should be omitted.  Per discussion with bradfitz@, updating the docs to
indicate that the struct fields are authoritative.

Change-Id: Id1807ff9d4ba5de425d8b147205f29b18351230f
Reviewed-on: https://go-review.googlesource.com/36842Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 074b73b1
...@@ -37,9 +37,10 @@ type Response struct { ...@@ -37,9 +37,10 @@ type Response struct {
// Header maps header keys to values. If the response had multiple // Header maps header keys to values. If the response had multiple
// headers with the same key, they may be concatenated, with comma // headers with the same key, they may be concatenated, with comma
// delimiters. (Section 4.2 of RFC 2616 requires that multiple headers // delimiters. (Section 4.2 of RFC 2616 requires that multiple headers
// be semantically equivalent to a comma-delimited sequence.) Values // be semantically equivalent to a comma-delimited sequence.) When
// duplicated by other fields in this struct (e.g., ContentLength) are // Header values are duplicated by other fields in this struct (e.g.,
// omitted from Header. // ContentLength, TransferEncoding, Trailer), the field values are
// authoritative.
// //
// Keys in the map are canonicalized (see CanonicalHeaderKey). // Keys in the map are canonicalized (see CanonicalHeaderKey).
Header Header Header Header
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment