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

🚀 Add automatic decompression for gzip, deflate, brotli #1401

Closed
sneakykiwi opened this issue Jun 23, 2021 · 0 comments · Fixed by #1402
Closed

🚀 Add automatic decompression for gzip, deflate, brotli #1401

sneakykiwi opened this issue Jun 23, 2021 · 0 comments · Fixed by #1402

Comments

@sneakykiwi
Copy link
Contributor

Is your feature request related to a problem?
Partly yes, I have an API that I rent out to my clients, the api's core function requires uploading a really big json, one of my clients came up with the idea of compressing the payload to reduce upload latency. He used the Content-Encoding: gzip headers, to my surprise, the payload didn't get uncompressed in the default fiber context body though.
Describe the solution you'd like
Have automatic compression detection and use that to decompress the body of the request
Describe alternatives you've considered
Turns out fasthttp has in fact an implementation for that, and for other compressions as well. I was able to write a simple switch statement and just do ctx.Request().BodyGunzip() and retrieve the uncompressed body
Additional context
Would make it a really cool feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants