IIS ASP Integrated Pipeline mode not calling the right module when URL end with a "static" filename

172 Views Asked by At

I have a module that is acting as a "proxy". It's needed to resolve some cross domain scripting issues I had. So the server will get the outside content and give it back to the client, and the client is staying within the same domain.

My issue is when there is a "static file" name at the end of the url, my handler is not getting called... Here is an example:

 http://my.url.com/myproxy.ashx/site1/getsomestuff.aspx?parm1=value1

I get an HTTP error 404 File Not Found for url myproxy.ashx/site1/getsomestuff.aspx

BUT, if I mangle the URL above so there is no dotted filename at the end of the URL like this:

 http://my.url.com/myproxy.ashx/site1/getsomestuff_aspx?parm1=value1

The handler for myproxy.ashx gets called. If I then put some kludge code to change getsomestuff_aspx to getsomestuff.aspx when I generate the URL to actually query - I've gotten it to work. But I am pretty sure, especially with Integrated Pipeline mode, that I SHOULD be able to SOMEWHERE say that if the URL has "myproxy.ashx/" somewhere in it, then call my handler module... Can someone point me in the right direction...

1

There are 1 best solutions below

0
Brian B On

I think I figured this one out: Added the following inside the system.webServer node of web.config:

 <handlers>   <add name="ProxyAll" preCondition="integratedMode" verb="GET,POST" path="myproxy.ashx*" type="MyNameSpace.MyProxy"/> </handlers>

The * after myproxy.ashx will match all the URLs even with static file names at the end.