Hi, I am using wiremock-standalone 3.0.1, and i ha...
# wiremock-java
b
Hi, I am using wiremock-standalone 3.0.1, and i have a client that sends chunked payload in the request, but i don't want wiremock to return chunked response , so i have set
Copy code
new WireMockServer(options().bindAddress(inetAddress.getHostAddress()).port(TestsConfiguration.Port)
        .useChunkedTransferEncoding(ChunkedEncodingPolicy.NEVER)
But even after setting this, i am getting chunked response, which can't be processed by the webTarget that I am using as my client. But instead when i force my webTarget to use http 1.1, everything works fine, i think the issue is because the requests gets upgraded to http 2. So, how can I force wiremock to use http 1.1 only? I reffered the documentation - https://wiremock.org/docs/configuration/#:~:text=options%3B%20WireMockServer%20wm%20%3D%20new%20WireMockServer,override%20for%20should%20be%20specified it mentions to set option -
Copy code
// Disable HTTP/2 over HTTP
.http2PlainDisabled(true);
But when i try to use it via options - it does not resolve method http2PlainDisabled(), the method related to http that i found is
Copy code
public WireMockConfiguration httpDisabled(boolean httpDisabled) {
    this.httpDisabled = httpDisabled;
    return this;
}
But I am not sure what it does. Can someone help me here?
l
So,
httpDisabled
disables the HTTP listener and is only available only if HTTPS is enabled. I would have expected
.http2PlainDisabled(true);
to have worked here but I might be misunderstanding what that option does.
b
Okay, .http2PlainDisabled(true); this option is not even available for me in package package com.github.tomakehurst.wiremock.core; I get this error on running my scenario - Caused by: IOException invoking http://ip:port/uri Can't get stream 1: java.io.EOFException: EOF reached while reading",
l
Are you able to update to the latests WireMock release?
b
Yes, I upgraded version 3.0.1 to the latest 3.8.0, and I could use method .http2PlainDisabled(true), which has helped me resolve my issue. I think the main issue is on the client side, I am using webTarget with quarkus, and in the request it sends a chunked payload with the header to upgrade to HTTP 2, but when wiremock returns the response in http2, it is not able to understand the response.
l
Glad to hear you have resolved the issue