From 7559c5c8f27d8006e693ffdf77661ce24973a851 Mon Sep 17 00:00:00 2001 From: sta Date: Thu, 25 Jun 2015 17:17:05 +0900 Subject: [PATCH] Fix for pull request #115, refactored a few for HttpConnection.cs --- websocket-sharp/Net/HttpConnection.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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 {