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