mirror of
https://github.com/jimeh/casecmp.git
synced 2026-02-19 10:26:40 +00:00
Update dependencies
This commit is contained in:
30
vendor/github.com/valyala/fasthttp/header.go
generated
vendored
30
vendor/github.com/valyala/fasthttp/header.go
generated
vendored
@@ -263,6 +263,12 @@ func (h *RequestHeader) SetContentLength(contentLength int) {
|
||||
}
|
||||
}
|
||||
|
||||
func (h *ResponseHeader) isCompressibleContentType() bool {
|
||||
contentType := h.ContentType()
|
||||
return bytes.HasPrefix(contentType, strTextSlash) ||
|
||||
bytes.HasPrefix(contentType, strApplicationSlash)
|
||||
}
|
||||
|
||||
// ContentType returns Content-Type header value.
|
||||
func (h *ResponseHeader) ContentType() []byte {
|
||||
contentType := h.contentType
|
||||
@@ -2008,19 +2014,21 @@ func normalizeHeaderKey(b []byte, disableNormalizing bool) {
|
||||
}
|
||||
|
||||
n := len(b)
|
||||
up := true
|
||||
for i := 0; i < n; i++ {
|
||||
switch b[i] {
|
||||
case '-':
|
||||
up = true
|
||||
default:
|
||||
if up {
|
||||
up = false
|
||||
uppercaseByte(&b[i])
|
||||
} else {
|
||||
lowercaseByte(&b[i])
|
||||
if n == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
b[0] = toUpperTable[b[0]]
|
||||
for i := 1; i < n; i++ {
|
||||
p := &b[i]
|
||||
if *p == '-' {
|
||||
i++
|
||||
if i < n {
|
||||
b[i] = toUpperTable[b[i]]
|
||||
}
|
||||
continue
|
||||
}
|
||||
*p = toLowerTable[*p]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user