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] Add out-of-the-box compression support to Tapir #2878

Open
liosedhel opened this issue May 9, 2023 · 0 comments · May be fixed by #4056
Open

[Feature] Add out-of-the-box compression support to Tapir #2878

liosedhel opened this issue May 9, 2023 · 0 comments · May be fixed by #4056

Comments

@liosedhel
Copy link
Contributor

liosedhel commented May 9, 2023

It would be great if Tapir supported out-of-the-box compressions.

If the client's request indicates the understanding of some compression algorithms through Accept-Encoding header:

GET /encrypted-area HTTP/1.1
Host: www.example.com
Accept-Encoding: gzip, deflate

The server can respond with, for example, gzip response indicated by Content-Encoding:

HTTP/1.1 200 OK
Date: mon, 26 June 2016 22:38:34 GMT
Server: Apache/1.3.3.7 (Unix)  (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
Accept-Ranges: bytes
Content-Length: 438
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Encoding: gzip

The Tapir endpoint definition should probably contain information about which compression algorithm is supported and which is preferred (?).
Servers like akka-http can support some of the compression mechanisms, see although it has to be manually incorporated to existing routes with encodeResponse directive. The same can be achieved in Netty through ChannelPipeline HttpContentCompressor step.

Thank you for this feature request consideration! ;)

@kciesielski kciesielski added this to the Netty / ease of use milestone Mar 15, 2024
@ArtyomGabeev ArtyomGabeev linked a pull request Sep 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants