reference Server in WebServerProcessRequestEventArgs

This commit is contained in:
Michael Becker 2024-08-12 23:11:56 -04:00
parent 94e3fcec40
commit a343a6477d
2 changed files with 4 additions and 2 deletions

View File

@ -281,7 +281,7 @@ public class WebServer
WebContext context = new WebContext((WebApplication)Application.Instance, new WebRequest(version, requestMethod, path, headers, pathVariables, form), new WebResponse(), session);
context.Response.Cookies.Add("JSESSIONID", cookieValue, WebCookieScope.FromPath("/"), WebCookieSecurity.Secure | WebCookieSecurity.HttpOnly, WebCookieSameSite.None);
WebServerProcessRequestEventArgs e = new WebServerProcessRequestEventArgs(client, context);
WebServerProcessRequestEventArgs e = new WebServerProcessRequestEventArgs(this, client, context);
OnProcessRequest(e);
if (e.Handled)
{

View File

@ -7,11 +7,13 @@ namespace MBS.Web;
public class WebServerProcessRequestEventArgs : EventArgs
{
public WebServer Server { get; }
public WebContext Context { get; }
public bool Handled { get; set; } = false;
public WebServerProcessRequestEventArgs(System.Net.Sockets.TcpClient client, WebContext context)
public WebServerProcessRequestEventArgs(WebServer server, System.Net.Sockets.TcpClient client, WebContext context)
{
Server = server;
Context = context;
}