added HttpServer to HttpContext
parent
eb741c9224
commit
a1a55d6d10
|
@ -4,10 +4,22 @@ namespace ln.http
|
|||
{
|
||||
public class HttpContext
|
||||
{
|
||||
public HTTPServer HttpServer { get; }
|
||||
public HttpRequest Request { get; set; }
|
||||
public HttpResponse Response { get; set; }
|
||||
public HttpPrincipal AuthenticatedPrincipal { get; private set; }
|
||||
|
||||
public HttpContext(HTTPServer httpServer)
|
||||
{
|
||||
HttpServer = httpServer;
|
||||
}
|
||||
|
||||
public HttpContext(HTTPServer httpServer, HttpRequest httpRequest) : this(httpServer)
|
||||
{
|
||||
Request = httpRequest;
|
||||
RoutableUri = httpRequest.RequestUri.AbsolutePath;
|
||||
}
|
||||
|
||||
public string RoutableUri { get; set; }
|
||||
|
||||
public bool Authenticate(HttpAuthenticationDelegate authenticationDelegate)
|
||||
|
|
|
@ -53,8 +53,7 @@ namespace ln.http
|
|||
if (httpRequest == null)
|
||||
break;
|
||||
|
||||
HttpContext httpContext = new HttpContext()
|
||||
{ Request = httpRequest, RoutableUri = httpRequest.RequestUri.AbsolutePath };
|
||||
HttpContext httpContext = new HttpContext(this, httpRequest);
|
||||
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue