When Mockoon proxy server receives an HTTP POST request with Expect: 100-continue header and a body from the client, it does not respond with an HTTP 100 response. This prevents the client from sending the actual POST request with body, and causes the proxy call to fail with a timeout.
To Reproduce
To reproduce the current behavior
Setup an environment with no routes and proxy to any address (http://www.google.com will suffice).
Listen on any port (we will use port 3000 for the example).
Send an HTTP POST call to Mockoon with an Expect: 100-continue header: curl -v http://127.0.0.1:3000/ -H 'Expect: 100-continue' -X POST -d '{"foo": "bar"}'
The request will hang.
To work around the problem and produce the desired behavior
Change the port that Mockoon is running on to something different (we will use port 3001 for the example).
Setup NGINX to listen on the port that Mockoon was originally running on and proxy traffic to the port from step 1, removing the Expect header before sending the request to Mockoon:
Send an HTTP POST call to NGINX with an Expect: 100-continue header: curl -v http://127.0.0.1:3000/ -H 'Expect: 100-continue' -X POST -d '{"foo": "bar"}'
NGINX will respond with an HTTP 100 response, and the client will send the POST request (which will result in an error, because the upstream doesn't allow POST requests).
Describe the bug
When Mockoon proxy server receives an HTTP POST request with
Expect: 100-continue
header and a body from the client, it does not respond with anHTTP 100
response. This prevents the client from sending the actual POST request with body, and causes the proxy call to fail with a timeout.To Reproduce
To reproduce the current behavior
http://www.google.com
will suffice).Expect: 100-continue
header:curl -v http://127.0.0.1:3000/ -H 'Expect: 100-continue' -X POST -d '{"foo": "bar"}'
To work around the problem and produce the desired behavior
Expect: 100-continue
header:curl -v http://127.0.0.1:3000/ -H 'Expect: 100-continue' -X POST -d '{"foo": "bar"}'
HTTP 100
response, and the client will send the POST request (which will result in an error, because the upstream doesn't allow POST requests).Mockoon version:
6.1.0, 4.1.0
OS / OS version:
macOS 13.x, Windows 10, Ubuntu 22.04