Stoping compression running twice#28
Conversation
|
Hi @rhysrevans3! Thanks for your PR. I will review it as soon as I can. Cheers 👍 |
|
plz review it! |
|
I apologize for the delay. I forgot this PR. I will review it and release a new version next week |
|
Hi, I was wondering about the status of this? |
ping |
| await self.send(self.initial_message) | ||
| await self.send(message) | ||
| headers = MutableHeaders(raw=self.initial_message["headers"]) | ||
| if "br" in headers.get("Content-Encoding", ""): |
There was a problem hiding this comment.
@rhysrevans3 I'm wondering: is OK here to check if there is the br compression explicitly, or should the middleware to prevent compressing again if there is any other compression? ("Content-Encoding" in headers)?
There was a problem hiding this comment.
This is a valid point. Because the main idea of this library is to be a drop-in replacement for the GZipMiddleware shipped with Starlette, I need to review the current state of the GZipMiddleware
https://github.com/Kludex/starlette/blob/main/starlette/middleware/gzip.py
|
@fullonic Are you still active on this repo? |
|
I apologize for the delay and lack of communication. For personal reasons, I have not been able to dedicate more time to coding outside of my daily work. This has not changed much, but at work we are now using this library, and I will be able to maintain it as part of our stack if there are major issues. Adding support for 3.13 and 3.14 will be done as well. |
|
I have released a new version with support for the new Python version and dropped support for versions not supported by Starlette. This one was left out of this new release because I couldn't pass the tests. I'm not sure in which scenarios it is doing double compression. Also, when looking at the GZipResponder, I don't see this kind of safeguard against double compression. |
Prevent the compression from being run multiple times.
closes #29