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.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/libgo/go/net/http/header.go b/libgo/go/net/http/header.go
index d847b131184..049f32f27dc 100644
--- a/libgo/go/net/http/header.go
+++ b/libgo/go/net/http/header.go
@@ -211,3 +211,13 @@ func hasToken(v, token string) bool {
func isTokenBoundary(b byte) bool {
return b == ' ' || b == ',' || b == '\t'
}
+
+func cloneHeader(h Header) Header {
+ h2 := make(Header, len(h))
+ for k, vv := range h {
+ vv2 := make([]string, len(vv))
+ copy(vv2, vv)
+ h2[k] = vv2
+ }
+ return h2
+}