我发布的ELMAH web应用程序有时会出现以下错误:
System.Web.HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (:).
at System.Web.HttpRequest.ValidateInputIfRequiredByConfig()
at System.Web.HttpApplication.PipelineStepManager.ValidateHelper(HttpContext context)
在elmah报告的URL中,我得到:
/https://domain.com/
我必须在web.config中放入以下行才能修复它吗?:
<httpRuntime requestValidationMode="2.0" />
这到底意味着什么?我应该小心点吗?
这些通常要么是机器人在爬你的网站,要么是黑客在搜索漏洞。通常他们没什么好担心的。也许你只是想让elmah忽略这些错误。添加过滤器:
<errorFilter>
<test>
<regex binding="Exception.Message"
pattern="(?ix: b potentially b.+?b dangerous b.+?b value b.+?b detected b.+?b client b )" />
</test>
http://code.google.com/p/elmah/wiki/ErrorFilterExamples