bruno icon indicating copy to clipboard operation
bruno copied to clipboard

[Bug] `Content-Length` and `Transfer-Encoding` headers break response

Open sergey124 opened this issue 2 years ago • 1 comments

When response has both Content-Length and Transfer-Encoding: chunked headers, Bruno fails to show response.

Steps to reproduce

  1. Call endpoint that returns both Content-Length and Transfer-Encoding: chunked headers.

Expected behavior

  • Show response body
  • Warn user about conflicting headers received

Actual behavior

  • No response body, error is shown:

Error invoking remote method 'send-http-request': Error: Parse Error: Content-Length can't be present with Transfer-Encoding image

Justificaiton

Standard requires us to ignore Content-Length in case of non-identity Transfer-Encoding, like "chunked", "compress", "deflate", or "gzip":

"Messages MUST NOT include both a Content-Length header field and a non-identity transfer-coding. If the message does include a non-identity transfer-coding, the Content-Length MUST be ignored." (RFC 2616, Section 4.4, point 3)

(c) https://stackoverflow.com/a/3304186

UPD: new RFC removed the part about ignoring, though it would be great to warn user in this case, it might simplify troubleshooting.

sergey124 avatar Feb 28 '24 16:02 sergey124

This is the exact issue i am having with confluent rest api. I am unable to turn off Content-Length and therefore just get the error mentioned. I was able to confirm this issue by using postman and turning off Content-Length in its hidden headers and my data was sent fine. Is there any plans for this bug, possibly the option to view hidden headers and disable, as i am very impressed with bruno.

chrisfield490 avatar Mar 27 '24 12:03 chrisfield490