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

Allow to configure Netty http compression #4056

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ArtyomGabeev
Copy link

Fixes: #2878

I'm unsure if I need to add tests since Netty provides the HttpContentCompressor.

Another question: I do not know about HttpStreamsServerHandler from Play Framework. Is it used for chunked HTTP responses?

HTTP compression should work with chunked responses by compressing each chunk. I need to check if the order of handlers is correct.

Thanks,
Artyom

@ArtyomGabeev
Copy link
Author

ArtyomGabeev commented Sep 22, 2024

Manually checked with ZIO netty server, compression works fine with ZIOStream's.

@adamw
Copy link
Member

adamw commented Sep 23, 2024

Thanks! HttpStreamsServerHandler is used for web sockets, so shouldn't (ideally ;) ) matter for these changes. But anyway, we do need tests - verifying if the compressor indeed is used (that is, if you indeed receive compressed responses), if there are no interactions with WS, and if it's in the right place. Not sure right now how it should be position wrt to handler and Logging, for example

@ArtyomGabeev
Copy link
Author

Ill check the LoggingHandler, but so far it works fine for me.
Ill check existing tests to find appropriate place for compression tests.

@adamw
Copy link
Member

adamw commented Sep 24, 2024

Maybe in NettyFutureServerTests, as these tests are netty-specific? https://github.com/softwaremill/tapir/blob/master/server/netty-server/src/test/scala/sttp/tapir/server/netty/NettyFutureServerTest.scala#L17

You can see an example on how to add a custom test e.g. here: https://github.com/softwaremill/tapir/blob/master/server/netty-server/sync/src/test/scala/sttp/tapir/server/netty/sync/NettySyncServerTest.scala#L45

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.

[Feature] Add out-of-the-box compression support to Tapir
2 participants