Skip to content

Commit 0901981

Browse files
committed
feat(serverCompress): assume xml based type is compressible
1 parent 223494b commit 0901981

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/serverCompress/util.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,19 @@ var compressibleTypes = []string{
99
"application/javascript",
1010
"application/x-javascript",
1111
"application/json",
12-
"application/xhtml+xml",
1312
"application/xml",
14-
"image/svg+xml",
1513
}
1614

1715
func isCompressibleType(contentType string) bool {
1816
if strings.HasPrefix(contentType, "text/") {
1917
return true
2018
}
2119

20+
// "image/svg+xml", "application/xhtml+xml", ...
21+
if strings.HasSuffix(contentType, "+xml") {
22+
return true
23+
}
24+
2225
sepIndex := strings.IndexByte(contentType, ';')
2326
if sepIndex > 0 {
2427
contentType = contentType[:sepIndex]

0 commit comments

Comments
 (0)