aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
diff options
context:
space:
mode:
authorConfusedPolarBear <33811686+ConfusedPolarBear@users.noreply.github.com>2020-05-02 15:29:05 -0500
committerConfusedPolarBear <33811686+ConfusedPolarBear@users.noreply.github.com>2020-05-02 15:33:45 -0500
commitdf65e3ab0db8fd55a6a02b8c067565abc926136f (patch)
treeafd80f18d79fece027853b0a17c671d4e7bea1ca /Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
parent62e251663fce8216cea529f85382299ac2f39fbc (diff)
Add Access-Control-Allow-Origin header to exceptions
Fixes #1794
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/HttpListenerHost.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpListenerHost.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
index 211a0c1d9..77878eacc 100644
--- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -542,6 +542,11 @@ namespace Emby.Server.Implementations.HttpServer
var requestInnerEx = GetActualException(requestEx);
var statusCode = GetStatusCode(requestInnerEx);
+ if (!httpRes.Headers.ContainsKey("Access-Control-Allow-Origin"))
+ {
+ httpRes.Headers.Add("Access-Control-Allow-Origin", "*");
+ }
+
// Do not handle 500 server exceptions manually when in development mode
// The framework-defined development exception page will be returned instead
if (statusCode == 500 && _hostEnvironment.IsDevelopment())