Fix for pull request #115, refactored a few for HttpConnection.cs
This commit is contained in:
parent
0516da098c
commit
7559c5c8f2
@ -41,6 +41,7 @@
|
|||||||
/*
|
/*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* - Liryna <liryna.stark@gmail.com>
|
* - Liryna <liryna.stark@gmail.com>
|
||||||
|
* - Rohan Singh <rohan-singh@hotmail.com>
|
||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -535,14 +536,11 @@ namespace WebSocketSharp.Net
|
|||||||
else
|
else
|
||||||
content.Append ("</h1></body></html>");
|
content.Append ("</h1></body></html>");
|
||||||
|
|
||||||
var enc = res.ContentEncoding;
|
var enc = Encoding.UTF8;
|
||||||
if (enc == null) {
|
|
||||||
enc = Encoding.UTF8;
|
|
||||||
res.ContentEncoding = enc;
|
|
||||||
}
|
|
||||||
|
|
||||||
var entity = enc.GetBytes (content.ToString ());
|
var entity = enc.GetBytes (content.ToString ());
|
||||||
|
res.ContentEncoding = enc;
|
||||||
res.ContentLength64 = entity.LongLength;
|
res.ContentLength64 = entity.LongLength;
|
||||||
|
|
||||||
res.Close (entity, true);
|
res.Close (entity, true);
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
|
Loading…
Reference in New Issue
Block a user