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

Feature: Allow excluding handlers from being compressed #21

Merged
merged 6 commits into from
Sep 28, 2022

Conversation

fullonic
Copy link
Owner

@fullonic fullonic commented Jul 19, 2022

fixes #19

Now is possible to exclude some handlers from being compressed when initializing the brotli middleware.

For example:

app.add_middleware(
    BrotliMiddleware,
    excluded_handlers=["/metrics", "/api/v1/ws", "/api/v1/sse"],
)

Note: Server Side Events handlers shouldn't be compressed.

@fullonic fullonic added the enhancement New feature or request label Jul 19, 2022
@fullonic fullonic self-assigned this Jul 19, 2022
@fullonic fullonic merged commit 4125806 into master Sep 28, 2022
@fullonic fullonic deleted the feature/allow-exclude-handlers branch September 29, 2022 15:04
tuffnatty added a commit to tuffnatty/zstd-asgi that referenced this pull request Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How can I exempt a specific route from using compression?
1 participant