Add Access-Control-Allow-Origin header to exceptions

Fixes #1794
This commit is contained in:
ConfusedPolarBear 2020-05-02 15:29:05 -05:00
parent 62e251663f
commit df65e3ab0d

View File

@ -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())