Reputation: 4179
What is the best way of working out whether or not a requested resource supports POST data before the request has been authenticated?
In my HttpMoudle, within the AuthenticateRequest
event, I am checking whether or not the path ends with ".aspx" but this feels crude and doesn't work for routed URLs.
I had explored checking the type of HttpContext.Current.Handler
but this is not assigned until later in the event chain.
Upvotes: 0
Views: 68
Reputation: 32323
ASP.NET doesn't know anything about what handler the request should be mapped to until the HttpApplication.PostMapRequestHandler
event. It's the ideal place to know which handler will be executed. Subscribing to the HttpApplication.AuthenticateRequest
event ensures that the request will be authenticated before processing the attached module or event handler only.
So the only way you can do it within the AuthenticateRequest
event, is to analyze the URL (as you do), I think.
Upvotes: 1