🐛 Fixes for websocket

This commit is contained in:
2025-07-10 15:57:00 +08:00
parent 7c0ad46deb
commit 17330fc104
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -8,10 +8,10 @@ using Swashbuckle.AspNetCore.Annotations;
namespace DysonNetwork.Sphere.Connection;
[ApiController]
[Route("/api/ws")]
[Route("/ws")]
public class WebSocketController(WebSocketService ws, ILogger<WebSocketContext> logger) : ControllerBase
{
[Route("/api/ws")]
[Route("/ws")]
[Authorize]
[SwaggerIgnore]
public async Task TheGateway()