diff options
| author | Tthecreator <epostvanthomas@kpnmail.nl> | 2019-01-22 15:22:42 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-22 15:22:42 +0000 |
| commit | 189b99df16bd4c93cc96422d7282d01d9ff5b82f (patch) | |
| tree | 26d7da95fe3e3b2772b8b39a2463a6c0ac7652fc /SocketHttpListener/Net/HttpListenerResponse.cs | |
| parent | a00c0defa8cb22774f5dc8a7d566eb36ac7307e8 (diff) | |
| parent | edcfd8b565f632088c8b1f826db8e2fbecf9790d (diff) | |
Merge pull request #1 from jellyfin/dev
Update from jellyfin repo
Diffstat (limited to 'SocketHttpListener/Net/HttpListenerResponse.cs')
| -rw-r--r-- | SocketHttpListener/Net/HttpListenerResponse.cs | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/SocketHttpListener/Net/HttpListenerResponse.cs b/SocketHttpListener/Net/HttpListenerResponse.cs index 351a206ee..a32aca043 100644 --- a/SocketHttpListener/Net/HttpListenerResponse.cs +++ b/SocketHttpListener/Net/HttpListenerResponse.cs @@ -1,14 +1,7 @@ using System; -using System.Collections.Generic; using System.IO; using System.Net; using System.Text; -using System.Threading.Tasks; -using System.Globalization; -using System.Runtime.InteropServices; -using System.ComponentModel; -using System.Diagnostics; -using Microsoft.Win32.SafeHandles; namespace SocketHttpListener.Net { @@ -22,16 +15,13 @@ namespace SocketHttpListener.Net private string _statusDescription; private WebHeaderCollection _webHeaders = new WebHeaderCollection(); - public WebHeaderCollection Headers - { - get { return _webHeaders; } - } + public WebHeaderCollection Headers => _webHeaders; public Encoding ContentEncoding { get; set; } public string ContentType { - get { return Headers["Content-Type"]; } + get => Headers["Content-Type"]; set { CheckDisposed(); @@ -46,13 +36,13 @@ namespace SocketHttpListener.Net } } - private HttpListenerContext HttpListenerContext { get { return _httpContext; } } + private HttpListenerContext HttpListenerContext => _httpContext; - private HttpListenerRequest HttpListenerRequest { get { return HttpListenerContext.Request; } } + private HttpListenerRequest HttpListenerRequest => HttpListenerContext.Request; internal EntitySendFormat EntitySendFormat { - get { return (EntitySendFormat)_boundaryType; } + get => (EntitySendFormat)_boundaryType; set { CheckDisposed(); @@ -71,8 +61,8 @@ namespace SocketHttpListener.Net public bool SendChunked { - get { return EntitySendFormat == EntitySendFormat.Chunked; } - set { EntitySendFormat = value ? EntitySendFormat.Chunked : EntitySendFormat.ContentLength; } + get => EntitySendFormat == EntitySendFormat.Chunked; + set => EntitySendFormat = value ? EntitySendFormat.Chunked : EntitySendFormat.ContentLength; } // We MUST NOT send message-body when we send responses with these Status codes @@ -92,7 +82,7 @@ namespace SocketHttpListener.Net public long ContentLength64 { - get { return _contentLength; } + get => _contentLength; set { CheckDisposed(); @@ -111,13 +101,13 @@ namespace SocketHttpListener.Net public CookieCollection Cookies { - get { return _cookies ?? (_cookies = new CookieCollection()); } - set { _cookies = value; } + get => _cookies ?? (_cookies = new CookieCollection()); + set => _cookies = value; } public bool KeepAlive { - get { return _keepAlive; } + get => _keepAlive; set { CheckDisposed(); @@ -137,7 +127,7 @@ namespace SocketHttpListener.Net public string RedirectLocation { - get { return Headers["Location"]; } + get => Headers["Location"]; set { // note that this doesn't set the status code to a redirect one |
