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

Wiremock 2.33.0+ - UnsupportedMediaType error on the back end for a GET request proxied by WireMock #1864

Closed
ubeogesh opened this issue Apr 25, 2022 · 0 comments · Fixed by #1865

Comments

@ubeogesh
Copy link
Contributor

ubeogesh commented Apr 25, 2022

I am using WireMock together with ChromeDriver - wiremock is instantiated and passed as a proxy to the ChromeDriver.

Here is how wiremock is instantiated:

    var wireMockServer = new WireMockServer(wireMockConfig().port(8888)
        .bindAddress("127.0.0.1")
        .enableBrowserProxying(true));
    wireMockServer.start();

On the chromedriver I just add the capabilities:

proxy.proxyType=manual
proxy.sslProxy=127.0.0.1:8888

In my back end application under test, there is one (and only) GET request that started failing with the new 2.33.0 (and 2.33.1) version of WireMock. The exception is "javax.ws.rs.NotSupportedException: HTTP 415 Unsupported Media Type".

I assume this happens because of this change in 2.33.0:

I don't think this is right default behavior. When I didn't have a request entity the proxy shouldn't just add it for no reason.

Would it be a decent solution would be to check if the content length is 0 before adding the entity?

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 a pull request may close this issue.

1 participant