Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce custom compression decision function in handler #96

Merged
merged 2 commits into from
Jan 12, 2025
Merged

Conversation

appleboy
Copy link
Member

  • Add detailed comments explaining the Handle function in handler.go
  • Modify the condition in Handle to include a custom compression decision function
  • Consolidate exclusion checks in shouldCompress into a single condition
  • Add a new field customShouldCompressFn to the config struct in options.go
  • Introduce WithCustomShouldCompressFn option for setting a custom compression decision function

fix #57

- Add detailed comments explaining the `Handle` function in `handler.go`
- Modify the condition in `Handle` to include a custom compression decision function
- Consolidate exclusion checks in `shouldCompress` into a single condition
- Add a new field `customShouldCompressFn` to the `config` struct in `options.go`
- Introduce `WithCustomShouldCompressFn` option for setting a custom compression decision function

Signed-off-by: appleboy <[email protected]>
- Add a test for custom compression function in gzip middleware

Signed-off-by: appleboy <[email protected]>
@appleboy appleboy merged commit 53b6bc1 into master Jan 12, 2025
7 checks passed
@appleboy appleboy deleted the fn branch January 12, 2025 15:11
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.

1 participant