SpectoLabs/hoverfly

Responses with status code 204 over HTTPS not working as expected

jonas-z-ericsson opened this issue · 2 comments

Description of the bug

https://datatracker.ietf.org/doc/html/rfc7230#section-3.3

All 1xx (Informational), 204 (No Content), and 304 (Not Modified) responses do not include a message body.

But when receiving e.g. a 204 when using HTTPS the receiving buffer contains '0\r\n'.
This will break some http clients.

It is probably related to this bug: #865

But now it only has that behaviour for requests with method HEAD: https://github.com/SpectoLabs/hoverfly/blob/master/vendor/github.com/SpectoLabs/goproxy/https.go#L289

Steps to reproduce the issue

Same as #865

Observed result

Hoverfly error messages seen (If none, say none)

None

Some clients can't handle this behaviour properly, e.g. jetty-client 12.0.7 for Java.

image

If possible, add screenshots to help explain your problem

Expected result

Additional relevant information

  1. Hoverfly version: 1.8.0
  2. Anything that might help us to diagnose the problem