summaryrefslogtreecommitdiff
path: root/libgo/go/net/http/header.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/net/http/header.go')
-rw-r--r--libgo/go/net/http/header.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/libgo/go/net/http/header.go b/libgo/go/net/http/header.go
index 049f32f27d..832169247f 100644
--- a/libgo/go/net/http/header.go
+++ b/libgo/go/net/http/header.go
@@ -1,4 +1,4 @@
-// Copyright 2010 The Go Authors. All rights reserved.
+// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@@ -25,16 +25,18 @@ func (h Header) Add(key, value string) {
}
// Set sets the header entries associated with key to
-// the single element value. It replaces any existing
+// the single element value. It replaces any existing
// values associated with key.
func (h Header) Set(key, value string) {
textproto.MIMEHeader(h).Set(key, value)
}
// Get gets the first value associated with the given key.
+// It is case insensitive; textproto.CanonicalMIMEHeaderKey is used
+// to canonicalize the provided key.
// If there are no values associated with the key, Get returns "".
-// To access multiple values of a key, access the map directly
-// with CanonicalHeaderKey.
+// To access multiple values of a key, or to use non-canonical keys,
+// access the map directly.
func (h Header) Get(key string) string {
return textproto.MIMEHeader(h).Get(key)
}
@@ -164,9 +166,9 @@ func (h Header) WriteSubset(w io.Writer, exclude map[string]bool) error {
}
// CanonicalHeaderKey returns the canonical format of the
-// header key s. The canonicalization converts the first
+// header key s. The canonicalization converts the first
// letter and any letter following a hyphen to upper case;
-// the rest are converted to lowercase. For example, the
+// the rest are converted to lowercase. For example, the
// canonical key for "accept-encoding" is "Accept-Encoding".
// If s contains a space or invalid header field bytes, it is
// returned without modifications.
@@ -186,7 +188,7 @@ func hasToken(v, token string) bool {
for sp := 0; sp <= len(v)-len(token); sp++ {
// Check that first character is good.
// The token is ASCII, so checking only a single byte
- // is sufficient. We skip this potential starting
+ // is sufficient. We skip this potential starting
// position if both the first byte and its potential
// ASCII uppercase equivalent (b|0x20) don't match.
// False positives ('^' => '~') are caught by EqualFold.