Commit adf1e4c5 authored by Andrew Gerrand's avatar Andrew Gerrand

http: corrected comment for Response.GetHeader.

Fixes #622.

R=rsc
CC=golang-dev
https://golang.org/cl/224084
parent f44fa9b4
...@@ -17,9 +17,9 @@ import ( ...@@ -17,9 +17,9 @@ import (
) )
var respExcludeHeader = map[string]int{ var respExcludeHeader = map[string]int{
"Content-Length": 0, "Content-Length": 0,
"Transfer-Encoding": 0, "Transfer-Encoding": 0,
"Trailer": 0, "Trailer": 0,
} }
// Response represents the response from an HTTP request. // Response represents the response from an HTTP request.
...@@ -152,11 +152,10 @@ func (r *Response) AddHeader(key, value string) { ...@@ -152,11 +152,10 @@ func (r *Response) AddHeader(key, value string) {
} }
} }
// GetHeader returns the value of the response header with the given // GetHeader returns the value of the response header with the given key.
// key, and true. If there were multiple headers with this key, their // If there were multiple headers with this key, their values are concatenated,
// values are concatenated, with a comma delimiter. If there were no // with a comma delimiter. If there were no response headers with the given
// response headers with the given key, it returns the empty string and // key, GetHeader returns an empty string. Keys are not case sensitive.
// false. Keys are not case sensitive.
func (r *Response) GetHeader(key string) (value string) { func (r *Response) GetHeader(key string) (value string) {
value, _ = r.Header[CanonicalHeaderKey(key)] value, _ = r.Header[CanonicalHeaderKey(key)]
return return
......
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