Skip to content

feat(middleware): add text/xml and application/xml to default compressible types#1127

Merged
VojtechVitek merged 2 commits into
masterfrom
compress-xml-defaults
Jul 3, 2026
Merged

feat(middleware): add text/xml and application/xml to default compressible types#1127
VojtechVitek merged 2 commits into
masterfrom
compress-xml-defaults

Conversation

@VojtechVitek

Copy link
Copy Markdown
Contributor

Summary

Supersedes #1126 with the test fix applied.

XML content compresses very effectively (typically 70-90% reduction) and is commonly served by web applications, APIs, and RSS/Atom feeds. This adds application/xml and text/xml to the default compressible content types list.

Note that application/atom+xml and application/rss+xml were already present — but generic XML was not.

Changes

Fixes #920. Closes #1126.

🤖 Generated with Claude Code

happysnaker and others added 2 commits July 3, 2026 16:00
…sible 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
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>
@VojtechVitek
VojtechVitek force-pushed the compress-xml-defaults branch from abca85a to 8f32af3 Compare July 3, 2026 15:29
@VojtechVitek

Copy link
Copy Markdown
Contributor Author

Fixes tests in #1126

@VojtechVitek
VojtechVitek merged commit d7b767b into master Jul 3, 2026
16 checks passed
@VojtechVitek
VojtechVitek deleted the compress-xml-defaults branch July 3, 2026 15:31
eleboucher pushed a commit to eleboucher/apoci that referenced this pull request Jul 6, 2026
…#132)

This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [github.com/go-chi/chi/v5](https://github.com/go-chi/chi) | `v5.3.0` → `v5.3.1` | ![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgo-chi%2fchi%2fv5/v5.3.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgo-chi%2fchi%2fv5/v5.3.0/v5.3.1?slim=true) |

---

### Release Notes

<details>
<summary>go-chi/chi (github.com/go-chi/chi/v5)</summary>

### [`v5.3.1`](https://github.com/go-chi/chi/releases/tag/v5.3.1)

[Compare Source](go-chi/chi@v5.3.0...v5.3.1)

#### What's Changed

- Honor Discard() in httpFancyWriter.ReadFrom by [@&#8203;DucMinhNe](https://github.com/DucMinhNe) in [#&#8203;1110](go-chi/chi#1110)
- Tidy build directives by [@&#8203;JRaspass](https://github.com/JRaspass) in [#&#8203;1113](go-chi/chi#1113)
- feat(middleware): add text/xml and application/xml to default compressible types by [@&#8203;VojtechVitek](https://github.com/VojtechVitek) in [#&#8203;1127](go-chi/chi#1127)
- Fix defaultLogEntry.Panic not respecting NoColor setting by [@&#8203;doganarif](https://github.com/doganarif) in [#&#8203;1050](go-chi/chi#1050)
- middleware: document printPrettyStack and harden NoColor panic test by [@&#8203;VojtechVitek](https://github.com/VojtechVitek) in [#&#8203;1131](go-chi/chi#1131)
- feat(mux): support http QUERY method ietf rfc10008 by [@&#8203;VojtechVitek](https://github.com/VojtechVitek) in [#&#8203;1132](go-chi/chi#1132)
- ci: pin GitHub Actions to full commit SHAs by [@&#8203;XananasX7](https://github.com/XananasX7) in [#&#8203;1116](go-chi/chi#1116)

#### New Contributors

- [@&#8203;DucMinhNe](https://github.com/DucMinhNe) made their first contribution in [#&#8203;1110](go-chi/chi#1110)
- [@&#8203;doganarif](https://github.com/doganarif) made their first contribution in [#&#8203;1050](go-chi/chi#1050)
- [@&#8203;XananasX7](https://github.com/XananasX7) made their first contribution in [#&#8203;1116](go-chi/chi#1116)

**Full Changelog**: <go-chi/chi@v5.3.0...v5.3.1>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.erwanleboucher.dev/eleboucher/apoci/pulls/132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

middleware.Compress should by default compress text/xml, application/xml, and arguably text/*

2 participants