eclipse-vertx / vert.x

Vert.x is a tool-kit for building reactive applications on the JVM
http://vertx.io
Other
14.32k stars 2.08k forks source link

Vert.x WebClient should support Content-Encoding: gzip/deflate on POST/PUT #4010

Closed mitkama closed 3 years ago

mitkama commented 3 years ago

Describe the feature

Vert.x WebClient at the moment does not support automatic decompression if the http response has Content-Encoding : gzip on POST/PUT Request.

If we add below code while creating Vert.x client, we only get below header in http response. "Transfer-Encoding": "chunked".

public VertxHttpClient(Vertx vertx) {
    this(vertx, new WebClientOptions().setTryUseCompression(true));
}

Use cases

This automatic decompression of http response header and body should also work with other response compression algorithms [Accept-Encoding:gzip, deflate, br].

This feature needs to be implemented in vert.x core.

vietj commented 3 years ago

can you open the issue in vertx-core instead ?

mitkama commented 3 years ago

@vietj Can you please point me to vertx-core repository in github, I was not able to locate it.

vietj commented 3 years ago

https://github.com/eclipse-vertx/vert.x

On Mon, Jul 12, 2021 at 11:23 AM mitkama @.***> wrote:

@vietj https://github.com/vietj Can you please point me to vertx-core repository in github, I was not able to locate it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eclipse-vertx/vert.x/issues/4010#issuecomment-878118548, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXDCR7Z3YZD7EOYQLY4KTTXKYB3ANCNFSM5AAFNASA .

mitkama commented 3 years ago

@vietj I don't get it , this issue is reported in the same repo ie. https://github.com/eclipse-vertx/vert.x

Do i need to specify any additional tag to link the issue and repo ?

vietj commented 3 years ago

ah right @mitkama sorry I misread because of WebClient

vietj commented 3 years ago

actually vertx core supports decompression but the option is named tryUseCompression , what is the actual issue you are referring to ?

mitkama commented 3 years ago

@vietj This is the issue

https://stackoverflow.com/questions/68210050/support-for-content-encoding-and-content-decoding-with-vert-x-webclient

vietj commented 3 years ago

I commented on the issue then, I think we will rename this option to setDecompressionSupported like on the server.

mitkama commented 3 years ago

@vietj The tests we performed with below code does not work with gzip decompression

    this(vertx, new WebClientOptions().setTryUseCompression(true));
}

Also on stack overflow you specified HttpClient, we are using a WebClient.

vietj commented 3 years ago

sure then it must be a bug and you should provide me a reproducer for it.

WebClientOptions extends HttpClientOptions

On Mon, Jul 19, 2021 at 6:44 PM mitkama @.***> wrote:

@vietj https://github.com/vietj The tests we performed with below code does not work with gzip decompression

this(vertx, new WebClientOptions().setTryUseCompression(true));

}

Also on stack overflow you specified HttpClient, we are using a WebClient.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eclipse-vertx/vert.x/issues/4010#issuecomment-882697013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXDCWGS354AGRCXDQQPTLTYRI53ANCNFSM5AAFNASA .

vietj commented 3 years ago

I checked that a POST request made with the HTTP client can receive and decompress a gzip HTTP server response and it works

mitkama commented 3 years ago

@vietj
Then it must be issue with WebClient , I tried same tests with WebClient and it doesn't work in my case.

vietj commented 3 years ago

can you provide a reproducer project ?

On Tue, Jul 20, 2021 at 10:10 AM mitkama @.***> wrote:

Then it must be issue with WebClient , I tried same tests with WebClient and it doesn't work in my case.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/eclipse-vertx/vert.x/issues/4010#issuecomment-883192255, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXDCQW27QALNP5FFUVK7DTYUVPXANCNFSM5AAFNASA .