diff --git a/header.go b/header.go index 0eb4b7ba42..73e98449d2 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. diff --git a/strings.go b/strings.go index 42f73c5c58..7f12cbc676 100644 --- a/strings.go +++ b/strings.go @@ -71,7 +71,12 @@ var ( strMultipartFormData = []byte("multipart/form-data") strBoundary = []byte("boundary") strBytes = []byte("bytes") - strTextSlash = []byte("text/") - strApplicationSlash = []byte("application/") strBasicSpace = []byte("Basic ") + + strApplicationSlash = []byte("application/") + strImageSVG = []byte("image/svg") + strImageIcon = []byte("image/x-icon") + strFontSlash = []byte("font/") + strMultipartSlash = []byte("multipart/") + strTextSlash = []byte("text/") )