From 4e4239cf74e23e13c3bee808104d8d213e40fe39 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Wed, 23 Jul 2014 15:04:20 +0200 Subject: [PATCH] Removed usage of HttpUtility UrlEncode and HttpUtility.UrlDecode as these has issues on Mono. --- HttpServer/HttpHelper.cs | 2 +- HttpServer/HttpRequest.cs | 4 +- HttpServer/HttpServer.csproj | 1 + HttpServer/HttpUtilityHelper.cs | 171 ++++++++++++++++++++++++++++++++++++++++ HttpServer/RequestCookie.cs | 2 +- HttpServer/ResponseCookie.cs | 2 +- 6 files changed, 177 insertions(+), 5 deletions(-) create mode 100644 HttpServer/HttpUtilityHelper.cs diff --git a/HttpServer/HttpHelper.cs b/HttpServer/HttpHelper.cs index 8d11daa..a0d286f 100755 --- a/HttpServer/HttpHelper.cs +++ b/HttpServer/HttpHelper.cs @@ -165,7 +165,7 @@ namespace HttpServer private static void Add(IHttpInput input, string name, string value) { - input.Add(HttpUtility.UrlDecode(name), HttpUtility.UrlDecode(value)); + input.Add(HttpUtilityHelper.UrlDecode(name), HttpUtilityHelper.UrlDecode(value)); } } } diff --git a/HttpServer/HttpRequest.cs b/HttpServer/HttpRequest.cs index a52dbed..cacbb7d 100755 --- a/HttpServer/HttpRequest.cs +++ b/HttpServer/HttpRequest.cs @@ -54,12 +54,12 @@ namespace HttpServer _queryString = HttpHelper.ParseQueryString(_uriPath.Substring(pos + 1)); _param.SetQueryString(_queryString); string path = _uriPath.Substring(0, pos); - _uriPath = System.Web.HttpUtility.UrlDecode(path) + "?" + _uriPath.Substring(pos + 1); + _uriPath = HttpUtilityHelper.UrlDecode(path) + "?" + _uriPath.Substring(pos + 1); UriParts = value.Substring(0, pos).Split(UriSplitters, StringSplitOptions.RemoveEmptyEntries); } else { - _uriPath = System.Web.HttpUtility.UrlDecode(_uriPath); + _uriPath = HttpUtilityHelper.UrlDecode(_uriPath); UriParts = value.Split(UriSplitters, StringSplitOptions.RemoveEmptyEntries); } } diff --git a/HttpServer/HttpServer.csproj b/HttpServer/HttpServer.csproj index 81bb2eb..431c406 100644 --- a/HttpServer/HttpServer.csproj +++ b/HttpServer/HttpServer.csproj @@ -134,6 +134,7 @@ +