diff --git a/websocket-sharp/Net/HttpConnection.cs b/websocket-sharp/Net/HttpConnection.cs index 21ea5050..3527731e 100644 --- a/websocket-sharp/Net/HttpConnection.cs +++ b/websocket-sharp/Net/HttpConnection.cs @@ -41,6 +41,7 @@ /* * Contributors: * - Liryna + * - Rohan Singh */ #endregion @@ -535,14 +536,11 @@ namespace WebSocketSharp.Net else content.Append (""); - var enc = res.ContentEncoding; - if (enc == null) { - enc = Encoding.UTF8; - res.ContentEncoding = enc; - } - + var enc = Encoding.UTF8; var entity = enc.GetBytes (content.ToString ()); + res.ContentEncoding = enc; res.ContentLength64 = entity.LongLength; + res.Close (entity, true); } catch {