From 9d61ef1eb9781661683773263470496dc67a0cdd Mon Sep 17 00:00:00 2001 From: tan133 <31919449+tan133@users.noreply.github.com> Date: Wed, 11 Oct 2017 23:57:55 +0800 Subject: [PATCH] fix a bug get QueryString when ContentEncoding is not UTF-8 if ContentEncoding is not UTF-8, InternalParseQueryString (_url.Query) will return value "?????" instead of the true value --- websocket-sharp/Net/HttpListenerRequest.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/websocket-sharp/Net/HttpListenerRequest.cs b/websocket-sharp/Net/HttpListenerRequest.cs index 701128120..60162a303 100644 --- a/websocket-sharp/Net/HttpListenerRequest.cs +++ b/websocket-sharp/Net/HttpListenerRequest.cs @@ -343,8 +343,10 @@ public Version ProtocolVersion { /// public NameValueCollection QueryString { get { + //fix bug, if ContentEncoding is GB2312 ,UrlDecode will return ??? + //TODO,how to get paratermers when method is POST return _queryString ?? - (_queryString = HttpUtility.InternalParseQueryString (_url.Query, Encoding.UTF8)); + (_queryString = HttpUtility.InternalParseQueryString (_url.Query,this.ContentEncoding)); } }