I have a big problem. There are devices in live that send the URL \"/updates \". It\'s a typo of the developer for those devices. In the server logs, it looks like \"/upd
According to some, this is in System.Web.dll
:
internal static void CheckSuspiciousPhysicalPath(string physicalPath)
{
if (((physicalPath != null) && (physicalPath.Length > 0))
&& (Path.GetFullPath(physicalPath) != physicalPath))
{
throw new HttpException(0x194, "");
}
}
I guess you cannot change that, but can't one disable it in the IIS settings? Of course, that would also disable all other checks... :-(
Or write some ISAPI filter that runs before the above code? Writing your own module is said to be easy, according to Handle URI hacking gracefully in ASP.NET.
Or, create your own error page. In this page (like suggested in the URI hacking link above) search for specific text in exception.TargetSite.Name
, such as CheckSuspiciousPhysicalPath
and if found (or simply always) look at current.Request.RawUrl or something like that, clear the error and redirect to a repaired URL?