Skip to content

changed the NewCompressor logic to be support wildcards in the defaul…#921

Closed
eteran wants to merge 3 commits into
go-chi:masterfrom
eteran:improved-compress-defaults
Closed

changed the NewCompressor logic to be support wildcards in the defaul…#921
eteran wants to merge 3 commits into
go-chi:masterfrom
eteran:improved-compress-defaults

Conversation

@eteran

@eteran eteran commented Jun 12, 2024

Copy link
Copy Markdown
  • changed the NewCompressor logic to be support wildcards in the default set like it already did for a custom list by reusing that logic
  • made defaultCompressibleContentTypes contain "text/*" as all text mime types are arguably very compressible added
  • application/xml to defaultCompressibleContentTypes since it is also a common XML mime type

…t set like it already did for a custom list by reusing that logic

made defaultCompressibleContentTypes contain "text/*" as all text mime types are arguably very compressible
added application/xml to defaultCompressibleContentTypes since it is also a common XML mime type
@VojtechVitek

Copy link
Copy Markdown
Contributor

@Neurostep can you help review this please?

@eteran

eteran commented Jun 28, 2024

Copy link
Copy Markdown
Author

Looks like it fails here:

--- FAIL: TestCompressorWildcards (0.01s)
    --- FAIL: TestCompressorWildcards/defaults (0.00s)

So perhaps I just need to update the tests now that some other things are being compressed. I'll see if I can fix it real quick

7 regular rules and 1 wildcard in the default ruleset
@eteran

eteran commented Jun 28, 2024

Copy link
Copy Markdown
Author

@VojtechVitek , @Neurostep

I updated the tests and now things pass locally. However, it looks like perhaps the CI workflow didn't rerun on github?

@Neurostep Neurostep left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall changes look good to me 👍 I wonder if we should bump the minor version here since we are going to change the default behavior of the middleware and all of a sudden for some clients the middleware is going to compress all text/* content types 🤔

@eteran

eteran commented Jul 11, 2024

Copy link
Copy Markdown
Author

@Neurostep / @VojtechVitek

Just wanted to follow up to see if there was anything you need on my end to help move things to the next steps.

@eteran

eteran commented Mar 28, 2025

Copy link
Copy Markdown
Author

@Neurostep / @VojtechVitek

I don't mean to bug, but it's been over 9 months. @Neurostep already reviewed it once, is there any likelihood of this being re-reviewed and merged anytime soon?

@eteran
eteran requested a review from Neurostep January 19, 2026 21:16

@Neurostep Neurostep left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@VojtechVitek

VojtechVitek commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Closing in favor of the cleaner, more minimal PR: #1126

Thank you!

@eteran

eteran commented Jul 3, 2026

Copy link
Copy Markdown
Author

Seems like an Inferior solution, but I guess better than nothing 2 years later 🤷‍♂️

@VojtechVitek

Copy link
Copy Markdown
Contributor

Merged via #1127. Thank you 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants