Merge pull request #3037 from ConfusedPolarBear/access-control

Fix CORS header not being added to exceptions
This commit is contained in:
Vasily 2020-05-19 13:05:45 +03:00 committed by GitHub
commit d9e2f56bd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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