diff options
| author | Claus Vium <clausvium@gmail.com> | 2019-02-27 07:32:36 +0100 |
|---|---|---|
| committer | Claus Vium <clausvium@gmail.com> | 2019-02-27 07:32:36 +0100 |
| commit | 77addb22835478a32c1133cfd69ae0da2ec5edea (patch) | |
| tree | dbe33961dd1a2b911e992f698495df453b8285af /SocketHttpListener/HttpBase.cs | |
| parent | 848cfc32cc89327e16ff6ea281dc1d9b96cc4f7a (diff) | |
Remove SocketHttpListener
Diffstat (limited to 'SocketHttpListener/HttpBase.cs')
| -rw-r--r-- | SocketHttpListener/HttpBase.cs | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/SocketHttpListener/HttpBase.cs b/SocketHttpListener/HttpBase.cs deleted file mode 100644 index c386b9374..000000000 --- a/SocketHttpListener/HttpBase.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Text; -using MediaBrowser.Model.Services; - -namespace SocketHttpListener -{ - internal abstract class HttpBase - { - #region Private Fields - - private QueryParamCollection _headers; - private Version _version; - - #endregion - - #region Protected Fields - - protected const string CrLf = "\r\n"; - - #endregion - - #region Protected Constructors - - protected HttpBase(Version version, QueryParamCollection headers) - { - _version = version; - _headers = headers; - } - - #endregion - - #region Public Properties - - public QueryParamCollection Headers => _headers; - - public Version ProtocolVersion => _version; - - #endregion - - #region Private Methods - - private static Encoding getEncoding(string contentType) - { - if (contentType == null || contentType.Length == 0) - return Encoding.UTF8; - - var i = contentType.IndexOf("charset=", StringComparison.Ordinal); - if (i == -1) - return Encoding.UTF8; - - var charset = contentType.Substring(i + 8); - i = charset.IndexOf(';'); - if (i != -1) - charset = charset.Substring(0, i).TrimEnd(); - - return Encoding.GetEncoding(charset.Trim('"')); - } - - #endregion - - #region Public Methods - - public byte[] ToByteArray() - { - return Encoding.UTF8.GetBytes(ToString()); - } - - #endregion - } -} |
