httpmodule

HttpModules and DOS attacks?

In the comments for this question, someone stated that use of HttpModules opens yourself up to DOS attacks. I would like to understand the reasoning behind this statement. I've found a couple articles that make use of HttpModules to handle/prevent DOS attacks. ...

Earliest access to the .net lifecycle

After looking at the .net on IIS7 application lifecycle: http://msdn.microsoft.com/en-us/library/ms178473.aspx For maximum performance, I want to find a way to get my code started as soon as the HttpContext object is created but before HttpApplication is. (it's easy to run code after the HttpApplication class is loaded but before any ...

Can a Classic ASP application be secured using HTTPModules?

I have a classic ASP application currently secured using ASP.NET Forms Authentication running on IIS 6, the problem is our purposes require this application implement a Single-Signon security model using Entrust TruePass which uses Client Certificates I believe. Can this be implemented using ASP.NET Http Modules or do I have to write an ...

Browser Detection in HttpModule

Is there a way to detect what browser the request is made in the HttpModule? Thanks. ...

ASP.NET: Your most used httpmodules

Interested in description of your most used ASP.NET httpmodules that solved a specific problem for your webapp. Best practices and in-the-field usages are welcome. ...

Attaching events to Session OnStart and OnEnd using HttpModules

Does anyone know a clean way of adding events to Session's OnStart and OnEnd events using an HttpModule (without touching the Global.asax file)? ...

Interaction between httpmodules and httphandlers

In our asp.net 2.0 app we are using httpmodule and httphandler to calculate some metrics via cookies. To calculate network transfer time, httpmodule:EndRequest stores Transferstart in the cookie and httphandler:Processrequest uses datetime.now to subtract the transferstart to determine overall network time. Is this correct? I am also unc...

HttpHandler is not processed when its associate HttpModule is processed

In our asp.net 2.0 application we have the an HttpModule and HttpHandler. They are registered in web.config to handle requests for certain file types. The request is initiated asynchronously from client side using MS AJAX. I noticed something strange: HttpHandler:ProcessRequest is not entered on every HttpModule:EndRequest which seems l...

What's the performance difference between HttpModule and Global.aspx ??

I have made a web app where I am using a module which redirects without "www" urls (http://example.com/) to with "www" urls (http://www.example.com/). But as I am on shared hosting server, where I don't have permission to implement a HttpModule, then I tried the same module code with Global.asax file. That works! I used the following (A...

"500 Internal Server Error" when adding HttpModule in my Website??

I am having a website (developed in ASP.NET 2.0 (C#)) registered with godaddy.com But when I am adding HttpModule in my web.config as follow: <httpModules> <add type="WwwSubDomainModule" name="WwwSubDomainModule" /> </httpModules> but it gives me "500 Internal Server Error". When I removed the above tag then my website is working f...

Detecting if a HttpModule is loaded

I'm trying to find a way to programmatically check if a particular HttpModule is loaded (as a component I'm writing requires the module to work correctly). I'm trying: bool ismodulepresent = false; foreach(HttpModuleAction module in ((HttpModulesSection)ConfigurationManager.GetSection("system.web/httpModules")).Modules) { if(module...

ASP.NET Post Application_Error Event

I'm trying to find an event that will fire immediately after all Application_Error event handlers so that I can modify the response sent (messing with the status code and 'location' headers and creating a new body specifically) using a custom HttpModule. I've tried hooking into Application_EndRequest (as I've read that this is the only ...

Redirecting from Global.asax in Medium Trust

I am attempting to do a redirect in the Application_Error handler in Global.asax. Nothing fancy at all. private void Application_Error(object sender, EventArgs e) { // ...snip... Server.Transfer(somePath, false); // ...snip... } This works great under Full trust, but I need to get it to work under Medium trust. The code I'm...

Network performance measurement in asp.net 2.0 via HttpHandlers and HttpModules strangeness

We have a performance measurement module that relies on HttpModule and HttpHandlers and works like this: Request comes in to server for a page. HttpModule_Begin writes start time in the cookie. HttpModule_End writes end time in the cookie. On client, when page load is finished, fire off a special request via AJAX that is handled by Htt...

IIS - Different processing of default document in Integrated Pipeline mode?

Hi all, I have an HTTP Module to handle authentication from Facebook, which works fine in classic pipeline mode. In integrated pipeline mode, however, I'm seeing an additional request pass through for the default document, which is causing the module to fail. We look at the request (from Facebook) to retrieve and validate the user a...

httpmodule, asp.net application interaction

Is there any way to call functions in a httpmodule from an asp.net application, even if the httpmodule is in another process? Better yet, in a situation where the application pool is running as a web garden (>1 worker process) how can I communicate with all of the httpmodules that are running? ...

multiple httpmodule instances

I have an asp.net website that uses a web application and they are both in the same application pool (with 1 worker process). The website has a httpmodule loaded in it's web.config file and curiously both the main website and the application will be served by seperate instances of the httpmodule. Why is this? Since they are in the sam...

How do I create a logging HttpModule/Decorator for a .net web service?

I created a web service in .net 3.5, and now I would like to log all incoming calls to the service. The log should contain the name of the called method and the parameters passed to it. I have been looking into creating a hhtpmodule for this, but I am not sure how to extract the method name and parameter values from HttpApplication. An...

What part of the ASP.Net framework do you use to execute arbitrary code on every inbound request to IIS?

I'd like to run a discrete chunk of .Net code for each and every request that comes through a certain Web site in IIS. This is completely isolated code -- it doesn't affect anything before or after it -- it logs some information from the request, then ends. Note that this is not something I can put in Application_OnRequestBegin or some...

Is there an event in the request pipeline where both Request and Response are available and populated?

I need to bind to an event in the request pipeline where both the Request and Response are populated. The Request is simple, but I need the StatusCode off the Response object. At what point in the pipeline is the Response populated? ...