Selaa lähdekoodia

Always allow set credentials header

crobibero 4 vuotta sitten
vanhempi
sitoutus
eba0d9e387
1 muutettua tiedostoa jossa 3 lisäystä ja 5 poistoa
  1. 3 5
      Jellyfin.Server/Middleware/DynamicCorsMiddleware.cs

+ 3 - 5
Jellyfin.Server/Middleware/DynamicCorsMiddleware.cs

@@ -52,12 +52,10 @@ namespace Jellyfin.Server.Middleware
                     && string.Equals(headerValue, "*", StringComparison.Ordinal))
                 {
                     context.Response.Headers[HeaderNames.AccessControlAllowOrigin] = context.Request.Host.Value;
-                    _logger.LogDebug("Overwriting CORS response header: {HeaderName}: {HeaderValue}", HeaderNames.AccessControlAllowOrigin, context.Request.Host.Value);
 
-                    if (!context.Response.Headers.ContainsKey(HeaderNames.AccessControlAllowCredentials))
-                    {
-                        context.Response.Headers[HeaderNames.AccessControlAllowCredentials] = "true";
-                    }
+                    // Always allow credentials.
+                    context.Response.Headers[HeaderNames.AccessControlAllowCredentials] = "true";
+                    _logger.LogDebug("Overwriting CORS response header: {HeaderName}: {HeaderValue}", HeaderNames.AccessControlAllowOrigin, context.Request.Host.Value);
                 }
             }