diff options
Diffstat (limited to 'SocketHttpListener/HttpResponse.cs')
| -rw-r--r-- | SocketHttpListener/HttpResponse.cs | 54 |
1 files changed, 11 insertions, 43 deletions
diff --git a/SocketHttpListener/HttpResponse.cs b/SocketHttpListener/HttpResponse.cs index 154a3d8e9..bcfa4a906 100644 --- a/SocketHttpListener/HttpResponse.cs +++ b/SocketHttpListener/HttpResponse.cs @@ -1,13 +1,11 @@ -using System; -using System.Collections.Specialized; -using System.IO; +using System; +using System.Linq; using System.Net; using System.Text; -using HttpStatusCode = SocketHttpListener.Net.HttpStatusCode; -using HttpVersion = SocketHttpListener.Net.HttpVersion; -using System.Linq; using MediaBrowser.Model.Services; using SocketHttpListener.Net; +using HttpStatusCode = SocketHttpListener.Net.HttpStatusCode; +using HttpVersion = SocketHttpListener.Net.HttpVersion; namespace SocketHttpListener { @@ -48,15 +46,9 @@ namespace SocketHttpListener #region Public Properties - public CookieCollection Cookies - { - get - { - return GetCookies(Headers, true); - } - } + public CookieCollection Cookies => GetCookies(Headers, true); - private CookieCollection GetCookies(QueryParamCollection headers, bool response) + private static CookieCollection GetCookies(QueryParamCollection headers, bool response) { var name = response ? "Set-Cookie" : "Cookie"; return headers == null || !headers.Contains(name) @@ -64,21 +56,9 @@ namespace SocketHttpListener : CookieHelper.Parse(headers[name], response); } - public bool IsProxyAuthenticationRequired - { - get - { - return _code == "407"; - } - } + public bool IsProxyAuthenticationRequired => _code == "407"; - public bool IsUnauthorized - { - get - { - return _code == "401"; - } - } + public bool IsUnauthorized => _code == "401"; public bool IsWebSocketResponse { @@ -92,21 +72,9 @@ namespace SocketHttpListener } } - public string Reason - { - get - { - return _reason; - } - } + public string Reason => _reason; - public string StatusCode - { - get - { - return _code; - } - } + public string StatusCode => _code; #endregion @@ -156,4 +124,4 @@ namespace SocketHttpListener #endregion } -}
\ No newline at end of file +} |
