mirror of
https://github.com/mudler/luet.git
synced 2025-07-12 06:38:16 +00:00
Instead of using gox on one side and an action to release, we can merge them together with goreleaser which will build for extra targets (arm, mips if needed in the future) and it also takes care of creating checksums, a source archive, and a changelog and creating a release with all the artifacts. All binaries should respect the old naming convention, so any scripts out there should still work. Signed-off-by: Itxaka <igarcia@suse.com>
88 lines
1.7 KiB
Go
88 lines
1.7 KiB
Go
// 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.
|
|
|
|
package http2
|
|
|
|
import (
|
|
"net/http"
|
|
"sync"
|
|
)
|
|
|
|
var (
|
|
commonBuildOnce sync.Once
|
|
commonLowerHeader map[string]string // Go-Canonical-Case -> lower-case
|
|
commonCanonHeader map[string]string // lower-case -> Go-Canonical-Case
|
|
)
|
|
|
|
func buildCommonHeaderMapsOnce() {
|
|
commonBuildOnce.Do(buildCommonHeaderMaps)
|
|
}
|
|
|
|
func buildCommonHeaderMaps() {
|
|
common := []string{
|
|
"accept",
|
|
"accept-charset",
|
|
"accept-encoding",
|
|
"accept-language",
|
|
"accept-ranges",
|
|
"age",
|
|
"access-control-allow-origin",
|
|
"allow",
|
|
"authorization",
|
|
"cache-control",
|
|
"content-disposition",
|
|
"content-encoding",
|
|
"content-language",
|
|
"content-length",
|
|
"content-location",
|
|
"content-range",
|
|
"content-type",
|
|
"cookie",
|
|
"date",
|
|
"etag",
|
|
"expect",
|
|
"expires",
|
|
"from",
|
|
"host",
|
|
"if-match",
|
|
"if-modified-since",
|
|
"if-none-match",
|
|
"if-unmodified-since",
|
|
"last-modified",
|
|
"link",
|
|
"location",
|
|
"max-forwards",
|
|
"proxy-authenticate",
|
|
"proxy-authorization",
|
|
"range",
|
|
"referer",
|
|
"refresh",
|
|
"retry-after",
|
|
"server",
|
|
"set-cookie",
|
|
"strict-transport-security",
|
|
"trailer",
|
|
"transfer-encoding",
|
|
"user-agent",
|
|
"vary",
|
|
"via",
|
|
"www-authenticate",
|
|
}
|
|
commonLowerHeader = make(map[string]string, len(common))
|
|
commonCanonHeader = make(map[string]string, len(common))
|
|
for _, v := range common {
|
|
chk := http.CanonicalHeaderKey(v)
|
|
commonLowerHeader[chk] = v
|
|
commonCanonHeader[v] = chk
|
|
}
|
|
}
|
|
|
|
func lowerHeader(v string) (lower string, ascii bool) {
|
|
buildCommonHeaderMapsOnce()
|
|
if s, ok := commonLowerHeader[v]; ok {
|
|
return s, true
|
|
}
|
|
return asciiToLower(v)
|
|
}
|