diff --git a/header.go b/header.go index 677219ae93..2d251c08b9 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 2a3d553c26..ee7015454e 100644 --- a/strings.go +++ b/strings.go @@ -81,7 +81,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/") )