aboutsummaryrefslogtreecommitdiff
path: root/SocketHttpListener/Net/HttpListenerResponse.Managed.cs
diff options
context:
space:
mode:
authorTthecreator <epostvanthomas@kpnmail.nl>2019-01-22 15:22:42 +0000
committerGitHub <noreply@github.com>2019-01-22 15:22:42 +0000
commit189b99df16bd4c93cc96422d7282d01d9ff5b82f (patch)
tree26d7da95fe3e3b2772b8b39a2463a6c0ac7652fc /SocketHttpListener/Net/HttpListenerResponse.Managed.cs
parenta00c0defa8cb22774f5dc8a7d566eb36ac7307e8 (diff)
parentedcfd8b565f632088c8b1f826db8e2fbecf9790d (diff)
Merge pull request #1 from jellyfin/dev
Update from jellyfin repo
Diffstat (limited to 'SocketHttpListener/Net/HttpListenerResponse.Managed.cs')
-rw-r--r--SocketHttpListener/Net/HttpListenerResponse.Managed.cs17
1 files changed, 6 insertions, 11 deletions
diff --git a/SocketHttpListener/Net/HttpListenerResponse.Managed.cs b/SocketHttpListener/Net/HttpListenerResponse.Managed.cs
index 8fb4518a1..f595fce7c 100644
--- a/SocketHttpListener/Net/HttpListenerResponse.Managed.cs
+++ b/SocketHttpListener/Net/HttpListenerResponse.Managed.cs
@@ -1,13 +1,10 @@
using System;
-using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
-using System.Threading.Tasks;
-using MediaBrowser.Model.Text;
-using SocketHttpListener.Primitives;
using System.Threading;
+using System.Threading.Tasks;
using MediaBrowser.Model.IO;
namespace SocketHttpListener.Net
@@ -19,12 +16,10 @@ namespace SocketHttpListener.Net
private int _statusCode = 200;
internal object _headersLock = new object();
private bool _forceCloseChunked;
- private ITextEncoding _textEncoding;
- internal HttpListenerResponse(HttpListenerContext context, ITextEncoding textEncoding)
+ internal HttpListenerResponse(HttpListenerContext context)
{
_httpContext = context;
- _textEncoding = textEncoding;
}
internal bool ForceCloseChunked => _forceCloseChunked;
@@ -39,7 +34,7 @@ namespace SocketHttpListener.Net
public Version ProtocolVersion
{
- get { return _version; }
+ get => _version;
set
{
CheckDisposed();
@@ -58,7 +53,7 @@ namespace SocketHttpListener.Net
public int StatusCode
{
- get { return _statusCode; }
+ get => _statusCode;
set
{
CheckDisposed();
@@ -264,8 +259,8 @@ namespace SocketHttpListener.Net
ComputeCookies();
}
- Encoding encoding = _textEncoding.GetDefaultEncoding();
- StreamWriter writer = new StreamWriter(ms, encoding, 256);
+ var encoding = Encoding.UTF8;
+ var writer = new StreamWriter(ms, encoding, 256);
writer.Write("HTTP/1.1 {0} ", _statusCode); // "1.1" matches Windows implementation, which ignores the response version
writer.Flush();
byte[] statusDescriptionBytes = WebHeaderEncoding.GetBytes(StatusDescription);