aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/header.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2018-12-03 17:01:18 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2018-12-03 20:09:50 +0000
commitf98081e51585ebb6c321ee2145b1e38312759ea3 (patch)
tree61ff8728a76dd12f03050cf574b3d91c8890efc8 /src/net/http/header.go
parentcef41e0d4b121ed31173a613039c32f5dd2e07f5 (diff)
downloadgo-f98081e51585ebb6c321ee2145b1e38312759ea3.tar.gz
go-f98081e51585ebb6c321ee2145b1e38312759ea3.zip
net/http: document CanonicalHeaderKey from Header
And remove some unnecessary textproto references. (The net/http package's CanonicalHeaderKey just calls textproto's CanonicalMIMEHeaderKey) Fixes #28894 Change-Id: Ibd277893a168368c593147a2677ad6130870cb88 Reviewed-on: https://go-review.googlesource.com/c/152157 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/net/http/header.go')
-rw-r--r--src/net/http/header.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/net/http/header.go b/src/net/http/header.go
index 6cf13e5c44..b699e7ef8f 100644
--- a/src/net/http/header.go
+++ b/src/net/http/header.go
@@ -15,12 +15,15 @@ import (
)
// A Header represents the key-value pairs in an HTTP header.
+//
+// The keys should be in canonical form, as returned by
+// CanonicalHeaderKey.
type Header map[string][]string
// Add adds the key, value pair to the header.
// It appends to any existing values associated with key.
// The key is case insensitive; it is canonicalized by
-// textproto.CanonicalMIMEHeaderKey.
+// CanonicalHeaderKey.
func (h Header) Add(key, value string) {
textproto.MIMEHeader(h).Add(key, value)
}
@@ -61,7 +64,7 @@ func (h Header) has(key string) bool {
// Del deletes the values associated with key.
// The key is case insensitive; it is canonicalized by
-// textproto.CanonicalMIMEHeaderKey.
+// CanonicalHeaderKey.
func (h Header) Del(key string) {
textproto.MIMEHeader(h).Del(key)
}