diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-10-12 15:43:28 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-12 15:43:28 -0400 |
| commit | 25ef9777cafee83c46ff53ede2caa04e3295e98a (patch) | |
| tree | 5f1e6045d0b4d4d5b7d8dcaadf035b326f36e672 /MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs | |
| parent | 0677d4ec990aee9a3bf7bda39dda01eb6fa66281 (diff) | |
| parent | 5be6cf05e34459a046aceaa16c891f3034859476 (diff) | |
Merge pull request #2224 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs index c55e98388..10d6f7493 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -93,12 +93,14 @@ namespace MediaBrowser.Server.Implementations.HttpServer } } } - - if (responseHeaders != null) + if (responseHeaders == null) { - AddResponseHeaders(result, responseHeaders); + responseHeaders = new Dictionary<string, string>(); } + responseHeaders["Expires"] = "-1"; + AddResponseHeaders(result, responseHeaders); + return result; } @@ -681,29 +683,6 @@ namespace MediaBrowser.Server.Implementations.HttpServer } } - /// <summary> - /// Gets the error result. - /// </summary> - /// <param name="statusCode">The status code.</param> - /// <param name="errorMessage">The error message.</param> - /// <param name="responseHeaders">The response headers.</param> - /// <returns>System.Object.</returns> - public void ThrowError(int statusCode, string errorMessage, IDictionary<string, string> responseHeaders = null) - { - var error = new HttpError - { - Status = statusCode, - ErrorCode = errorMessage - }; - - if (responseHeaders != null) - { - AddResponseHeaders(error, responseHeaders); - } - - throw error; - } - public object GetAsyncStreamWriter(IAsyncStreamSource streamSource) { return new AsyncStreamWriter(streamSource); |
