This commit is contained in:
dingo
2026-01-30 15:01:53 -05:00
parent eefa5b365b
commit 1a05246973
+17
View File
@@ -231,6 +231,23 @@ app.Use(async (ctx, next) =>
});
// ---- Session middleware (must be before routing) ----
app.UseSession();
app.Use(async (ctx, next) =>
{
var af = ctx.Request.Cookies[".Divers.Admin.AntiForgery"];
app.Logger.LogInformation("AF cookie present={Present} len={Len} prefix={Prefix}",
af != null,
af?.Length ?? 0,
af == null ? "" : af.Substring(0, Math.Min(25, af.Length)));
await next();
if (ctx.Response.Headers.TryGetValue("Set-Cookie", out var setCookies))
{
foreach (var sc in setCookies)
if (sc.Contains(".Divers.Admin.AntiForgery", StringComparison.OrdinalIgnoreCase))
app.Logger.LogInformation("SET-COOKIE AF: {SetCookie}", sc);
}
});
// ---- WebSockets endpoint ----
app.UseWebSockets(new WebSocketOptions { KeepAliveInterval = TimeSpan.FromSeconds(20) });