question

PeterGibbons-2751 avatar image
0 Votes"
PeterGibbons-2751 asked PeterGibbons-2751 commented

Intercept ARR caching with custom IIS module

We use a custom IIS module to validate certain parameters of a client request. When we activate ARR caching on the same IIS server, the request is handled directly by ARR and not passed to the module, thus our checks are passed without validation. Changing the module order does not change the behavior. Is there a way to intercept ARR caching with a custom IIS module, so the request first gets to be handley by the module and then passed to ARR caching?

windows-server-iis
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered PeterGibbons-2751 commented

there is pipeline ordering, but it controls the order the modules are called for pipeline events. that is if two modules register for the same event handler, the order they are called in. you probably need to support an earlier event.

https://docs.microsoft.com/en-us/dotnet/api/system.web.httpapplication?redirectedfrom=MSDN&view=netframework-4.8#events

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for your reply.
We use the event PreRequestHandlerExecute, which should be the first available event - but the documentation is not very clear about this. When we change the module order, so our module is before the ARR module, it still does not execute before ARR.

0 Votes 0 ·

We fixed it! BeginRequest was the event handler to intercept ARR!
Thanks a lot Bruce, your answer led to the solution.

0 Votes 0 ·