Request body decompression not working

173 views
Skip to first unread message

Jakub Skoczen

unread,
Apr 30, 2022, 12:09:38 PM4/30/22
to vert.x
Hi Guys,

I have a vert.x server with HttpServerOptions#setDecompressionSupported(true) but ctx.getBodyAsJson() fails with "Json body application/json parsing error: Failed to decode:Illegal character" seemingly trying to parse compressed body.

In the client I compress the request body with gzip and set the Content-Encoding header to gzip. 

What's weird is that I have a JUnit test where I instantiate the HttpServer and do test requests and decompression works fine. The failure only appears when I am running the server from a (fat) jar file. Any help will be greatly appreciated.

Jakub Skoczen

unread,
Apr 30, 2022, 12:52:55 PM4/30/22
to vert.x
Hi. again,

I fixed the problem -- I have enabled HTTP/2 in the client build but kept HTTP/1.1 in the tests. Is there any specific reason why decompression doesn't work with HTTP/2 or should I create a bug report?

Thomas SEGISMONT

unread,
May 2, 2022, 3:52:17 AM5/2/22
to ve...@googlegroups.com
There shouldn't be any difference between HTTP/2 and HTTP/1.1 regarding payload compression. If you can share a simple reproducer on GitHub or elsewhere, we can get a better or idea of what's going on.

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/7947026e-2b67-44e8-a4b1-e4d281a0f851n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages