🐛 Fixes for websocket
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user