🐛 Fixes for websocket
This commit is contained in:
@ -33,7 +33,7 @@ public class ClientTypeMiddleware(RequestDelegate next)
|
|||||||
|
|
||||||
context.Items["IsWebPage"] = isWebPage;
|
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(
|
context.Response.Redirect(
|
||||||
$"/api{context.Request.Path.Value}{context.Request.QueryString.Value}",
|
$"/api{context.Request.Path.Value}{context.Request.QueryString.Value}",
|
||||||
permanent: false
|
permanent: false
|
||||||
|
@ -8,10 +8,10 @@ using Swashbuckle.AspNetCore.Annotations;
|
|||||||
namespace DysonNetwork.Sphere.Connection;
|
namespace DysonNetwork.Sphere.Connection;
|
||||||
|
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("/api/ws")]
|
[Route("/ws")]
|
||||||
public class WebSocketController(WebSocketService ws, ILogger<WebSocketContext> logger) : ControllerBase
|
public class WebSocketController(WebSocketService ws, ILogger<WebSocketContext> logger) : ControllerBase
|
||||||
{
|
{
|
||||||
[Route("/api/ws")]
|
[Route("/ws")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[SwaggerIgnore]
|
[SwaggerIgnore]
|
||||||
public async Task TheGateway()
|
public async Task TheGateway()
|
||||||
|
Reference in New Issue
Block a user