Closed tyzhnenko closed 1 year ago
Hi @tyzhnenko Thank You for your contribution, I appreciate this very much! I thought many times to adding something similar but always postponed that.
I have two recommendations:
Something like:
handled_content_types = {
b"json",
b"xml",
b"yaml",
b"html",
b"text/plain",
b"application/javascript",
b"text/css",
b"text/csv",
}
def handle_content_type(self, content_type: bytes) -> bool:
lower_content_type = content_type.lower()
return any(fragment in lower_content_type for fragment in self.handled_content_types)
# handle request only if the content type should be handled
If you don´t have more time to spare, we can merge sooner and I can add these small changes before releasing to PyPi. 😄
@RobertoPrevato take a look, please
I've addressed all suggestions. If you have any other ideas or suggestions please share them with me.
@tyzhnenko it looks great! We can merge it soon, I only have a few final remarks about a typo and a small change on the executor side.
@tyzhnenko it looks great! We can merge it soon, I only have a few final remarks about a typo and a small change on the executor side.
@RobertoPrevato Sure. Just put your remarks somewhere and I gonna handle them
@tyzhnenko it looks great! We can merge it soon, I only have a few final remarks about a typo and a small change on the executor side.
@RobertoPrevato Sure. Just put your remarks somewhere and I gonna handle them
Thanks - I forgot to submit the review.
Patch coverage: 94.11
% and project coverage change: -0.04
:warning:
Comparison is base (
1de19c6
) 97.91% compared to head (0283443
) 97.88%.
:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@tyzhnenko Thank You for your contribution - I merge this and release it to PyPi as soon as possible. In the next days I'll focus on updating the documentation for version 2. I'm also looking into Copier to add a CLI to blacksheep to scaffold project templates.
Add GzipMiddleware class that compresses response body if request Accept-Encoding header contains 'gzip'
Add GzipMiddleware for app_1, app_2, app_3, app_4 integration tests servers
Add unit tests for GzipMiddleware