diff options
| author | Claus Vium <clausvium@gmail.com> | 2019-02-27 14:23:39 +0100 |
|---|---|---|
| committer | Claus Vium <clausvium@gmail.com> | 2019-02-27 14:23:39 +0100 |
| commit | 27e7e792b3d95912787c613f849548809d48f6b1 (patch) | |
| tree | 4088af01b46efb0881ba43db33bb60f56ca91911 /MediaBrowser.Model | |
| parent | 91afaaf8fe43035bb4832da44b6d6741d2815fb5 (diff) | |
Replace some usage of QueryParamCollection
Diffstat (limited to 'MediaBrowser.Model')
| -rw-r--r-- | MediaBrowser.Model/Services/IHttpRequest.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Model/Services/IHttpResponse.cs | 12 | ||||
| -rw-r--r-- | MediaBrowser.Model/Services/IRequest.cs | 21 | ||||
| -rw-r--r-- | MediaBrowser.Model/Services/QueryParamCollection.cs | 20 |
4 files changed, 5 insertions, 53 deletions
diff --git a/MediaBrowser.Model/Services/IHttpRequest.cs b/MediaBrowser.Model/Services/IHttpRequest.cs index 579f80c96..50c6076f3 100644 --- a/MediaBrowser.Model/Services/IHttpRequest.cs +++ b/MediaBrowser.Model/Services/IHttpRequest.cs @@ -3,11 +3,6 @@ namespace MediaBrowser.Model.Services public interface IHttpRequest : IRequest { /// <summary> - /// The HttpResponse - /// </summary> - IHttpResponse HttpResponse { get; } - - /// <summary> /// The HTTP Verb /// </summary> string HttpMethod { get; } diff --git a/MediaBrowser.Model/Services/IHttpResponse.cs b/MediaBrowser.Model/Services/IHttpResponse.cs index a8b79f394..b99d12525 100644 --- a/MediaBrowser.Model/Services/IHttpResponse.cs +++ b/MediaBrowser.Model/Services/IHttpResponse.cs @@ -4,17 +4,5 @@ namespace MediaBrowser.Model.Services { public interface IHttpResponse : IResponse { - //ICookies Cookies { get; } - - /// <summary> - /// Adds a new Set-Cookie instruction to Response - /// </summary> - /// <param name="cookie"></param> - void SetCookie(Cookie cookie); - - /// <summary> - /// Removes all pending Set-Cookie instructions - /// </summary> - void ClearCookies(); } } diff --git a/MediaBrowser.Model/Services/IRequest.cs b/MediaBrowser.Model/Services/IRequest.cs index 0fd4ea37b..edb5a2509 100644 --- a/MediaBrowser.Model/Services/IRequest.cs +++ b/MediaBrowser.Model/Services/IRequest.cs @@ -1,20 +1,15 @@ using System; using System.Collections.Generic; using System.IO; -using System.Net; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Model.IO; +using Microsoft.AspNetCore.Http; namespace MediaBrowser.Model.Services { public interface IRequest { - /// <summary> - /// The underlying ASP.NET or HttpListener HttpRequest - /// </summary> - object OriginalRequest { get; } - IResponse Response { get; } /// <summary> @@ -51,9 +46,9 @@ namespace MediaBrowser.Model.Services /// </summary> Dictionary<string, object> Items { get; } - QueryParamCollection Headers { get; } + IHeaderDictionary Headers { get; } - QueryParamCollection QueryString { get; } + IQueryCollection QueryString { get; } Task<QueryParamCollection> GetFormData(); @@ -123,20 +118,14 @@ namespace MediaBrowser.Model.Services Stream OutputStream { get; } /// <summary> - /// Signal that this response has been handled and no more processing should be done. - /// When used in a request or response filter, no more filters or processing is done on this request. - /// </summary> - void Close(); - - /// <summary> /// Gets a value indicating whether this instance is closed. /// </summary> - bool IsClosed { get; } + bool IsClosed { get; set; } //Add Metadata to Response Dictionary<string, object> Items { get; } - QueryParamCollection Headers { get; } + IHeaderDictionary Headers { get; } Task TransmitFile(string path, long offset, long count, FileShareMode fileShareMode, IFileSystem fileSystem, IStreamHelper streamHelper, CancellationToken cancellationToken); diff --git a/MediaBrowser.Model/Services/QueryParamCollection.cs b/MediaBrowser.Model/Services/QueryParamCollection.cs index 9f23b2420..4631a3b63 100644 --- a/MediaBrowser.Model/Services/QueryParamCollection.cs +++ b/MediaBrowser.Model/Services/QueryParamCollection.cs @@ -1,10 +1,7 @@ using System; using System.Collections.Generic; -using System.Collections.Specialized; using System.Linq; -using System.Net; using MediaBrowser.Model.Dto; -using Microsoft.AspNetCore.Http; namespace MediaBrowser.Model.Services { @@ -13,23 +10,6 @@ namespace MediaBrowser.Model.Services { public QueryParamCollection() { - - } - - public QueryParamCollection(IHeaderDictionary headers) - { - foreach (var pair in headers) - { - Add(pair.Key, pair.Value); - } - } - - public QueryParamCollection(IQueryCollection queryCollection) - { - foreach (var pair in queryCollection) - { - Add(pair.Key, pair.Value); - } } private static StringComparison GetStringComparison() |
