MCPcopy Create free account
hub / github.com/ContentSquare/chproxy / sortHeader

Function sortHeader

utils.go:242–249  ·  view source on GitHub ↗

splits header string in sorted slice

(header string)

Source from the content-addressed store, hash-verified

240
241// splits header string in sorted slice
242func sortHeader(header string) string {
243 h := strings.Split(header, ",")
244 for i, v := range h {
245 h[i] = strings.TrimSpace(v)
246 }
247 sort.Strings(h)
248 return strings.Join(h, ",")
249}
250
251func getDecompressor(req *http.Request) decompressor {
252 if req.Header.Get("Content-Encoding") == "gzip" {

Callers 2

newCacheKeyFunction · 0.85
testSortHeadersFunction · 0.85

Calls

no outgoing calls

Tested by 1

testSortHeadersFunction · 0.68