From 134d79a7f399716706200e796bd5ff90823ec3e3 Mon Sep 17 00:00:00 2001 From: sta Date: Fri, 17 Jan 2014 14:57:38 +0900 Subject: [PATCH] Fix a few --- websocket-sharp/WsStream.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/websocket-sharp/WsStream.cs b/websocket-sharp/WsStream.cs index 4bbaaee9..981233a0 100644 --- a/websocket-sharp/WsStream.cs +++ b/websocket-sharp/WsStream.cs @@ -132,12 +132,11 @@ namespace WebSocketSharp throw new WebSocketException ( "The header part of a handshake is greater than the limit length."); + var crlf = "\r\n"; return Encoding.UTF8.GetString (buffer.ToArray ()) - .Replace ("\r\n", "\n") - .Replace ("\n ", " ") - .Replace ("\n\t", " ") - .TrimEnd ('\n') - .Split ('\n'); + .Replace (crlf + " ", " ") + .Replace (crlf + "\t", " ") + .Split (new string [] { crlf }, StringSplitOptions.RemoveEmptyEntries); } #endregion