aboutsummaryrefslogtreecommitdiff
path: root/header.go
diff options
context:
space:
mode:
authorGravatar Kyle Unverferth <kyle@kyleu.com> 2021-09-07 02:03:41 -0600
committerGravatar GitHub <noreply@github.com> 2021-09-07 10:03:41 +0200
commit713da4e33f2b5af08241edc5712cf43d7e3b0e65 (patch)
tree685bf76def387ff829deae033f39c04c5003aab3 /header.go
parentremove unnecessary op (#1095) (diff)
downloadfasthttp-713da4e33f2b5af08241edc5712cf43d7e3b0e65.tar.gz
fasthttp-713da4e33f2b5af08241edc5712cf43d7e3b0e65.tar.bz2
fasthttp-713da4e33f2b5af08241edc5712cf43d7e3b0e65.zip
Adding new compressible prefixes (#1092)v1.30.0
* Adding "image/svg" as compressible prefix * Adding additional compressible prefixes from https://support.cloudflare.com/hc/en-us/articles/200168396-What-will-Cloudflare-compress-
Diffstat (limited to 'header.go')
-rw-r--r--header.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/header.go b/header.go
index 0eb4b7b..73e9844 100644
--- a/header.go
+++ b/header.go
@@ -271,7 +271,11 @@ func (h *RequestHeader) SetContentLength(contentLength int) {
func (h *ResponseHeader) isCompressibleContentType() bool {
contentType := h.ContentType()
return bytes.HasPrefix(contentType, strTextSlash) ||
- bytes.HasPrefix(contentType, strApplicationSlash)
+ bytes.HasPrefix(contentType, strApplicationSlash) ||
+ bytes.HasPrefix(contentType, strImageSVG) ||
+ bytes.HasPrefix(contentType, strImageIcon) ||
+ bytes.HasPrefix(contentType, strFontSlash) ||
+ bytes.HasPrefix(contentType, strMultipartSlash)
}
// ContentType returns Content-Type header value.