Skip to content

Conversation

@psyonara
Copy link

@psyonara psyonara commented Oct 22, 2019

Added compress_exempt decorator, companion logic in middleware, and unit test.

Please review critically and let me know if I've missed anything.

Ref: #5

@friedelwolff
Copy link
Owner

Thank you for this contribution!

A few comments:

  • Personally I would prefer the wording "dont_compress_page" (as mirror of the current "compress_page"). I think "exempt" is not such a common word and might not be optimally accessible to a wide developer audience.
  • I'm happy to see the test! However, I think we need to do a bit more. Please also add a test case for a streaming response, but more importantly, we need to have a test (maybe in test_middleware.py) that applies the decorator, and then the compression middleware and then verifies that it is not compressed. This will be the intended use case (middleware in effect with an override applied with this decorator).

Thanks again!

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.

2 participants