diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-10-27 23:17:31 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-27 23:17:31 -0400 |
| commit | 57f83a2744fb5ebdf5774d51d2125ea46f4ce8ab (patch) | |
| tree | f0a8c9137d24160fe8e2955bff7010163f2d4066 /MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs | |
| parent | 8fcc7a0385b9db202c1f93ee897eb5a11d2759da (diff) | |
| parent | f6acc5fbff081728138564867a58b7848c92c467 (diff) | |
Merge pull request #2256 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs b/MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs index ee05702f4..f5a11ae1f 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs @@ -5,6 +5,7 @@ using System; using System.Globalization; using System.Net; using System.Text; +using MediaBrowser.Model.Services; namespace MediaBrowser.Server.Implementations.HttpServer { @@ -46,21 +47,21 @@ namespace MediaBrowser.Server.Implementations.HttpServer var vary = "Accept-Encoding"; - var hasOptions = dto as IHasOptions; + var hasHeaders = dto as IHasHeaders; var sharpResponse = res as WebSocketSharpResponse; - if (hasOptions != null) + if (hasHeaders != null) { - if (!hasOptions.Options.ContainsKey("Server")) + if (!hasHeaders.Headers.ContainsKey("Server")) { - hasOptions.Options["Server"] = "Mono-HTTPAPI/1.1, UPnP/1.0 DLNADOC/1.50"; - //hasOptions.Options["Server"] = "Mono-HTTPAPI/1.1"; + hasHeaders.Headers["Server"] = "Mono-HTTPAPI/1.1, UPnP/1.0 DLNADOC/1.50"; + //hasHeaders.Headers["Server"] = "Mono-HTTPAPI/1.1"; } // Content length has to be explicitly set on on HttpListenerResponse or it won't be happy string contentLength; - if (hasOptions.Options.TryGetValue("Content-Length", out contentLength) && !string.IsNullOrEmpty(contentLength)) + if (hasHeaders.Headers.TryGetValue("Content-Length", out contentLength) && !string.IsNullOrEmpty(contentLength)) { var length = long.Parse(contentLength, UsCulture); @@ -85,13 +86,13 @@ namespace MediaBrowser.Server.Implementations.HttpServer } } - string hasOptionsVary; - if (hasOptions.Options.TryGetValue("Vary", out hasOptionsVary)) + string hasHeadersVary; + if (hasHeaders.Headers.TryGetValue("Vary", out hasHeadersVary)) { - vary = hasOptionsVary; + vary = hasHeadersVary; } - hasOptions.Options["Vary"] = vary; + hasHeaders.Headers["Vary"] = vary; } //res.KeepAlive = false; |
