diff --git a/websocket-sharp/Net/HttpListenerResponse.cs b/websocket-sharp/Net/HttpListenerResponse.cs index 1ea61cb8..4bcb0300 100644 --- a/websocket-sharp/Net/HttpListenerResponse.cs +++ b/websocket-sharp/Net/HttpListenerResponse.cs @@ -683,10 +683,14 @@ namespace WebSocketSharp.Net ); } - if (!_sendChunked) - headers.InternalSet ("Content-Length", _contentLength.ToString (prov), true); - else + if (!_sendChunked) { + headers.InternalSet ( + "Content-Length", _contentLength.ToString (prov), true + ); + } + else { headers.InternalSet ("Transfer-Encoding", "chunked", true); + } /* * Apache forces closing the connection for these status codes: