Skip to content

The Free Software Media System - Server Backend & API

Try another fix

Claus Vium5262e50fee32
diff --git a/Jellyfin.Server/SocketSharp/WebSocketSharpListener.cs b/Jellyfin.Server/SocketSharp/WebSocketSharpListener.cs
index 3b98753181..9c8d3e1d81 100644
--- a/Jellyfin.Server/SocketSharp/WebSocketSharpListener.cs
+++ b/Jellyfin.Server/SocketSharp/WebSocketSharpListener.cs
@@ -171,17 +171,13 @@ namespace Jellyfin.Server.SocketSharp
else
{
_logger.LogWarning("Web socket connection not allowed");
- statusCode = 401;
+ TryClose(ctx, 401);
}
}
catch (Exception ex)
{
_logger.LogError(ex, "AcceptWebSocketAsync error");
- statusCode = 500;
- }
- finally
- {
- TryClose(ctx, statusCode);
+ TryClose(ctx, 500);
}
}