wiremock / wiremock-docker

Wiremock Docker image
https://hub.docker.com/r/wiremock/wiremock
MIT License
211 stars 99 forks source link

When setup as proxy failing in Docker mode but not standalone #26

Closed swebb99uk closed 4 years ago

swebb99uk commented 4 years ago

Hi,

I have a standalone wiremock with an extension that I am able to setup with stubs to act as a proxy for specific https requests, it forwards them on to the real server and uses my extension to modify the response using regex changes. This all works and my browser gets the responses and is happy.

When I run the same logic in wiremock docker the browser marks the request as failed but swagger shows a 200 response being returned with the body I expect. I then used curl to confirm everything was as expected however it fails as well with the following reason. I'm at a loss to know why this is happening only when running in docker. Any idea's ?

I am running using the following command:

docker run -it --rm -p 18443:8443 webby/wiremock --https-port 8443 --disable-gzip=true --extensions com.mystuff.BodyTransformer

swebb99uk commented 4 years ago

Hi,

I've figured out the problem (not sure why docker causes it mind, maybe the server version being run). Basically http2 doesn't handle encoding of chunked. So in the stub i specified the accepted encoding in the request a Gzip and in my transform i deal with unzipping and zipping up of the body of the response as well as regex on the contends. Thats worked around the problem.

Thanks Steve