diff --git a/Program.cs b/Program.cs index 6dca525..77d05f8 100644 --- a/Program.cs +++ b/Program.cs @@ -125,6 +125,15 @@ builder.Services.AddDataProtection() //} var app = builder.Build(); +app.Use(async (ctx, next) => +{ + var raw = ctx.Request.Headers.Cookie.ToString(); + if (!string.IsNullOrEmpty(raw)) + app.Logger.LogInformation("RAW Cookie: {Raw}", raw); + + await next(); +}); + var fwdOpts = new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto @@ -229,8 +238,7 @@ app.Use(async (ctx, next) => await next(); }); -// ---- Session middleware (must be before routing) ---- -app.UseSession(); + app.Use(async (ctx, next) => { var af = ctx.Request.Cookies[".Divers.Admin.AntiForgery"]; @@ -249,6 +257,10 @@ app.Use(async (ctx, next) => } }); +// ---- Session middleware (must be before routing) ---- +app.UseSession(); + + // ---- WebSockets endpoint ---- app.UseWebSockets(new WebSocketOptions { KeepAliveInterval = TimeSpan.FromSeconds(20) });