diff --git a/DysonNetwork.Sphere/Connection/ClientTypeMiddleware.cs b/DysonNetwork.Sphere/Connection/ClientTypeMiddleware.cs index 937efb5..cf0cbc3 100644 --- a/DysonNetwork.Sphere/Connection/ClientTypeMiddleware.cs +++ b/DysonNetwork.Sphere/Connection/ClientTypeMiddleware.cs @@ -33,7 +33,7 @@ public class ClientTypeMiddleware(RequestDelegate next) context.Items["IsWebPage"] = isWebPage; - if (!isWebPage && !context.Request.Path.StartsWithSegments("/api")) + if (!isWebPage && context.Request.Path != "/ws" && !context.Request.Path.StartsWithSegments("/api")) context.Response.Redirect( $"/api{context.Request.Path.Value}{context.Request.QueryString.Value}", permanent: false diff --git a/DysonNetwork.Sphere/Connection/WebSocketController.cs b/DysonNetwork.Sphere/Connection/WebSocketController.cs index 484f12e..3bf61cf 100644 --- a/DysonNetwork.Sphere/Connection/WebSocketController.cs +++ b/DysonNetwork.Sphere/Connection/WebSocketController.cs @@ -8,10 +8,10 @@ using Swashbuckle.AspNetCore.Annotations; namespace DysonNetwork.Sphere.Connection; [ApiController] -[Route("/api/ws")] +[Route("/ws")] public class WebSocketController(WebSocketService ws, ILogger logger) : ControllerBase { - [Route("/api/ws")] + [Route("/ws")] [Authorize] [SwaggerIgnore] public async Task TheGateway()