mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
websocket logging
This commit is contained in:
@@ -28,13 +28,22 @@ public class WebSocketProxyMiddleware
|
||||
|
||||
public async Task InvokeAsync(HttpContext context)
|
||||
{
|
||||
// Log ALL requests to /socket path for debugging
|
||||
if (context.Request.Path.StartsWithSegments("/socket", StringComparison.OrdinalIgnoreCase))
|
||||
// Log ALL requests for debugging
|
||||
var path = context.Request.Path.Value ?? "";
|
||||
var isWebSocket = context.WebSockets.IsWebSocketRequest;
|
||||
|
||||
// Log any request that might be WebSocket-related
|
||||
if (path.Contains("socket", StringComparison.OrdinalIgnoreCase) ||
|
||||
path.Contains("ws", StringComparison.OrdinalIgnoreCase) ||
|
||||
isWebSocket ||
|
||||
context.Request.Headers.ContainsKey("Upgrade"))
|
||||
{
|
||||
_logger.LogInformation("📡 Request to /socket path - IsWebSocketRequest: {IsWs}, Method: {Method}, Headers: {Headers}",
|
||||
context.WebSockets.IsWebSocketRequest,
|
||||
_logger.LogInformation("🔍 Potential WebSocket request: Path={Path}, IsWs={IsWs}, Method={Method}, Upgrade={Upgrade}, Connection={Connection}",
|
||||
path,
|
||||
isWebSocket,
|
||||
context.Request.Method,
|
||||
string.Join(", ", context.Request.Headers.Select(h => $"{h.Key}={h.Value}")));
|
||||
context.Request.Headers["Upgrade"].ToString(),
|
||||
context.Request.Headers["Connection"].ToString());
|
||||
}
|
||||
|
||||
// Check if this is a WebSocket request to /socket
|
||||
|
||||
Reference in New Issue
Block a user