feat(middleware): add text/xml and application/xml to default compressible types (#1127)
* feat(middleware): add text/xml and application/xml to default compressible types XML content compresses very effectively and is commonly served by web applications. This adds text/xml and application/xml to the default compressible content types list. Fixes #920 * test(middleware): derive default compressible types count from the slice PR #1126 added application/xml and text/xml to defaultCompressibleContentTypes but did not update the TestCompressorWildcards/defaults assertion, which hardcoded the expected count at 10. Derive it from len(defaultCompressibleContentTypes) instead so the test stays correct as defaults are added or removed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: happysnaker <73147033+happysnaker@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3b50c7cc35
commit
d7b767bcbe
2 changed files with 3 additions and 1 deletions
|
|
@ -23,6 +23,8 @@ var defaultCompressibleContentTypes = []string{
|
|||
"application/json",
|
||||
"application/atom+xml",
|
||||
"application/rss+xml",
|
||||
"application/xml",
|
||||
"text/xml",
|
||||
"image/svg+xml",
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ func TestCompressorWildcards(t *testing.T) {
|
|||
}{
|
||||
{
|
||||
name: "defaults",
|
||||
typesCount: 10,
|
||||
typesCount: len(defaultCompressibleContentTypes),
|
||||
},
|
||||
{
|
||||
name: "no wildcard",
|
||||
|
|
|
|||
Loading…
Reference in a new issue