Closed lewright12 closed 4 years ago
Thank you for the detailed and excellent bug report. This is now fixed and I've added a test to cover this exact scenario. It is now available in the SNAPSHOT version: http://mock-server.com/where/maven_central.html#sonatype_snapshot and will be in a release in the next week or so.
Firstly, Thanks for the tool, well done.
While working with the mock-server in forwarding mode, I encountered an API call that we had to make that returned an XML document without a Content-Length header. This caused mock server to not respond as shown in the following example. (Hopefully this may help someone else.)
Mock Server Code:
Simple Python Server To demonstrate:
Curl requests showing the error:
Reviewing the HTTP RFC 2616 the server SHOULD send the Content-Length header. But digging in a little deeper it seems that the server can just close the connection and not send the Content-Length. I was looking at section 4.4 ( server closing the connection ) and section 14.13 ( Content-Length definition ). Perhaps my interpretation is wrong, please let me know if so.
My stack trace from Mock Server: