public static void ApplicationEndRequest(System.Web.HttpRequest request, System.Web.HttpContext context) { CarlJonasLeanderOutputFilterStream filter = (CarlJonasLeanderOutputFilterStream)context.Items["filter"]; string response = filter.ReadStream(); PrintRequestResponse(request, response); }
public static void ApplicationBeginRequest(System.Web.HttpResponse response, System.Web.HttpContext context) { CarlJonasLeanderOutputFilterStream filter = new CarlJonasLeanderOutputFilterStream(response.Filter); response.Filter = filter; context.Items["filter"] = filter; }
protected void Application_EndRequest() { if (HttpContext.Current.User != null) //Never null { var aaa = HttpContext.Current.User.Identity.Name; } CarlJonasLeander.ApplicationEndRequest(HttpContext.Current.Request, this.Context); Log("EndRequest URL = " + this.Request.Url.AbsolutePath + ", " + this.Request.HttpMethod); if (HttpContext.Current.User.Identity.IsAuthenticated && this.Request.Url.AbsolutePath.IndexOf('.') == -1 && this.Request.Url.AbsolutePath.IndexOf("GoBackward") == -1 && this.Request.Url.AbsolutePath.IndexOf("GoForward") == -1 && this.Request.Url.AbsolutePath.IndexOf("Log") == -1) { CachedResponseWrapper cachedResponseWrapperObj = CachedResponseWrapper.GetCachedResponseWrapperObj(); if (cachedResponseWrapperObj != null) { CarlJonasLeanderOutputFilterStream filter = (CarlJonasLeanderOutputFilterStream)this.Context.Items["filter"]; string response = filter.ReadStream(); cachedResponseWrapperObj.CachNewResponse(response); int returnCode = this.Response.StatusCode; } } }