Fix for pull request #115, refactored a few for HttpConnection.cs

This commit is contained in:
sta 2015-06-25 17:17:05 +09:00
parent 0516da098c
commit 7559c5c8f2

View File

@ -41,6 +41,7 @@
/*
* Contributors:
* - Liryna <liryna.stark@gmail.com>
* - Rohan Singh <rohan-singh@hotmail.com>
*/
#endregion
@ -535,14 +536,11 @@ namespace WebSocketSharp.Net
else
content.Append ("</h1></body></html>");
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 {