diff options
| author | ConfusedPolarBear <33811686+ConfusedPolarBear@users.noreply.github.com> | 2020-05-18 14:30:23 -0500 |
|---|---|---|
| committer | ConfusedPolarBear <33811686+ConfusedPolarBear@users.noreply.github.com> | 2020-05-18 14:31:47 -0500 |
| commit | 85f04af04c7d33477df5486ae80b6fa9a2a2bfd7 (patch) | |
| tree | 0afa6191798c2570ec4133f58fd76089d128d6f9 | |
| parent | 3a61c9a878110485c2e5385d0260959beefeb9d4 (diff) | |
Reuse existing CORS function
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/HttpListenerHost.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs index 9554b9f46..9a4e858a5 100644 --- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -497,9 +497,9 @@ namespace Emby.Server.Implementations.HttpServer var requestInnerEx = GetActualException(requestEx); var statusCode = GetStatusCode(requestInnerEx); - if (!httpRes.Headers.ContainsKey("Access-Control-Allow-Origin")) + foreach (var (key, value) in GetDefaultCorsHeaders(httpReq)) { - httpRes.Headers.Add("Access-Control-Allow-Origin", "*"); + httpRes.Headers.Add(key, value); } bool ignoreStackTrace = |
