say I have a folder in my web app, with an index.html
inside it:
/test
/test/index.html
and the following Module
public class TestModule : IHttpModule
{
public void Init(HttpApplication context)
{
context.ReleaseRequestState += context_ReleaseRequestState;
}
static void context_ReleaseRequestState(object sender, EventArgs e)
{
var application = sender as HttpApplication;
// foo
}
}
If I make a request to /test/index.html
, context_ReleaseRequestState
fires and the response is returned, great.
If I make a request to /test/
, context_ReleaseRequestState
fires as above, the response is returned, but then context_ReleaseRequestState
fires again!
The response has already been returned (and the connection closed, etc).
The HttpContext.Response
object has the followng properties set on it:
HeadersWritten: true
Headers: Server=Microsoft-IIS%2f7.5
What is causing this second invocation?
on the Request
the FilePath
property for the first invocation is /test/index.html
, and for the second its /test/
Is there some property on the HttpApplication
or HttpRequest
that I can check that identifies this 2nd request for whatever it is? The HeadersWritten
property is internal :(
Thanks