From f5e98d42c6a48df7faca5ec282120b656b05c32f Mon Sep 17 00:00:00 2001 From: sta Date: Sat, 10 Nov 2018 16:46:49 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/HttpUtility.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index df85dd60..d49b986e 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -563,22 +563,23 @@ namespace WebSocketSharp.Net private static void urlEncode (byte b, Stream output) { if (b > 31 && b < 127) { - if (b == 32) { + var c = (char) b; + if (c == ' ') { output.WriteByte ((byte) '+'); return; } - if (isNumeric (b)) { + if (isNumeric (c)) { output.WriteByte (b); return; } - if (isAlphabet (b)) { + if (isAlphabet (c)) { output.WriteByte (b); return; } - if (isUnreserved (b)) { + if (isUnreserved (c)) { output.WriteByte (b); return; }