Skip to content

Commit

Permalink
gzhttp: Exclude more common archive formats (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost committed Jun 1, 2022
1 parent 9ca8064 commit ba62340
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gzhttp/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,11 @@ func parseCoding(s string) (coding string, qvalue float64, err error) {
}

// Don't compress any audio/video types.
var excludePrefixDefault = []string{"video/", "audio/"}
var excludePrefixDefault = []string{"video/", "audio/", "image/jp"}

// Skip a bunch of compressed types that contains this string.
var excludeContainsDefault = []string{"compress", "zip"}
// Curated by supposedly still active formats on https://en.wikipedia.org/wiki/List_of_archive_formats
var excludeContainsDefault = []string{"compress", "zip", "snappy", "lzma", "xz", "zstd", "brotli", "stuffit"}

// DefaultContentTypeFilter excludes common compressed audio, video and archive formats.
func DefaultContentTypeFilter(ct string) bool {
Expand Down

0 comments on commit ba62340

Please sign in to comment.