| // Copyright 2014 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. |
| // See https://code.google.com/p/go/source/browse/CONTRIBUTORS |
| // Licensed under the same terms as Go itself: |
| // https://code.google.com/p/go/source/browse/LICENSE |
| commonLowerHeader = map[string]string{} // Go-Canonical-Case -> lower-case |
| commonCanonHeader = map[string]string{} // lower-case -> Go-Canonical-Case |
| for _, v := range []string{ |
| "access-control-allow-origin", |
| "strict-transport-security", |
| chk := http.CanonicalHeaderKey(v) |
| commonLowerHeader[chk] = v |
| commonCanonHeader[v] = chk |
| func lowerHeader(v string) string { |
| if s, ok := commonLowerHeader[v]; ok { |
| return strings.ToLower(v) |