aboutsummaryrefslogtreecommitdiff
path: root/SocketHttpListener/HttpResponse.cs
diff options
context:
space:
mode:
authorAndrew Rabert <6550543+nvllsvm@users.noreply.github.com>2019-01-22 18:13:47 -0500
committerGitHub <noreply@github.com>2019-01-22 18:13:47 -0500
commit28483bdb54be96ae83e0fded097f534d7e26ba1e (patch)
treee7f4b92326417ebf55eecdf68a01d2c3b9e660d7 /SocketHttpListener/HttpResponse.cs
parent920c39454c05e979eabe81877269cd4517a03ccf (diff)
parent8106c8393b711a7e1d40487e3caf2b014decbe28 (diff)
Merge pull request #651 from jellyfin/release-10.1.0
Release 10.1.0
Diffstat (limited to 'SocketHttpListener/HttpResponse.cs')
-rw-r--r--SocketHttpListener/HttpResponse.cs54
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
+}