Update dependencies

This commit is contained in:
2017-08-28 00:04:21 +01:00
parent b4adc35cac
commit 57a85b35e7
33 changed files with 542 additions and 976 deletions

View File

@@ -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]
}
}