aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/WebSocketManager.cs
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2021-11-13 07:27:28 -0700
committerCody Robibero <cody@robibe.ro>2021-11-13 07:27:28 -0700
commit4a28f46cac30e2e1fabc84016d710bcd309a5344 (patch)
tree3cae630deab87943278399c7e5161fa93a4a5d22 /Emby.Server.Implementations/HttpServer/WebSocketManager.cs
parent8868b34d78bdb34f4c47aa4b8e81a1a3cd699ded (diff)
Don't throw exception on unauthenticated requests
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/WebSocketManager.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/WebSocketManager.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/HttpServer/WebSocketManager.cs b/Emby.Server.Implementations/HttpServer/WebSocketManager.cs
index f86bfd755..e99876dce 100644
--- a/Emby.Server.Implementations/HttpServer/WebSocketManager.cs
+++ b/Emby.Server.Implementations/HttpServer/WebSocketManager.cs
@@ -35,7 +35,12 @@ namespace Emby.Server.Implementations.HttpServer
/// <inheritdoc />
public async Task WebSocketRequestHandler(HttpContext context)
{
- _ = await _authService.Authenticate(context.Request).ConfigureAwait(false);
+ var authorizationInfo = await _authService.Authenticate(context.Request).ConfigureAwait(false);
+ if (!authorizationInfo.IsAuthenticated)
+ {
+ throw new SecurityException("Token is required");
+ }
+
try
{
_logger.LogInformation("WS {IP} request", context.Connection.RemoteIpAddress);