diff options
| author | Vasily <JustAMan@users.noreply.github.com> | 2020-05-19 13:05:45 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-19 13:05:45 +0300 |
| commit | d9e2f56bd2c77224c5d45b1e164e0cacc9551968 (patch) | |
| tree | 526f9f54dc88496e4fd18297ef9416c7d5a6cb4d /Emby.Server.Implementations/HttpServer | |
| parent | 585e9e6220c50bac5c224ac1ee3a90ce625ef3c6 (diff) | |
| parent | 949e4d3e64a73102d0a87c8b34918397a2cec303 (diff) | |
Merge pull request #3037 from ConfusedPolarBear/access-control
Fix CORS header not being added to exceptions
Diffstat (limited to 'Emby.Server.Implementations/HttpServer')
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/HttpListenerHost.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs index 043812290..7de4f168c 100644 --- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -496,6 +496,15 @@ namespace Emby.Server.Implementations.HttpServer { var requestInnerEx = GetActualException(requestEx); var statusCode = GetStatusCode(requestInnerEx); + + foreach (var (key, value) in GetDefaultCorsHeaders(httpReq)) + { + if (!httpRes.Headers.ContainsKey(key)) + { + httpRes.Headers.Add(key, value); + } + } + bool ignoreStackTrace = requestInnerEx is SocketException || requestInnerEx is IOException |
