Project: mule
Issue MULE-8676: HTTP listener should ignore 'Transfer-Encoding' property as it is a hop-by-hop header
Transfer-Encoding is a hop-by-hop header and therefore shouldn't really be used by HTTP listener if there is a "transfer-encoding" property present in the outbound property scope to determine response streaming behaviour. Generally current behaviour is fine, but there is one case that is currently incorrect IMO. * We shouldn't stream a String payload when the "transfer-encoding" outbound message property is present. * We shouldn't stream a String payload when the "transfer-encoding" and "content-length" outbound message properties are both present. * Aso, While I think it is probably correct that a String payload should be streamed when a "transfer-encoding" header is configured and streaming mode is 'AUTO'. This is not the way the user should be enabling streaming and I suggest we log an INFO message whenever a transfer-encoding header is set suggesting the user uses the responseStreamingMode attribute instead. Failing test that show this can be found in this branch: https://github.com/mulesoft/mule/compare/MULE-8676 *AUTO Behaviour appears to be inconsistent with HTTP requestor because the presence of both transfer-encoding/content-length headers results in no streaming with requestor, but streaming with listener*
Story points: 8