在我的事件日志中,我已经收到了大量这样的异常。
EVENT ID: 1309
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 12/12/2011 1:40:41 PM
Event time (UTC): 12/12/2011 8:40:41 PM
Event ID: f85f113a40d349f5a1fe9ef481038281
Event sequence: 8993
Event occurrence: 1463
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/12/ROOT-1-129681577057031250
Trust level: Full
Application Virtual Path: /
Application Path: C:\inetpub\wwwroot\gouki\
Machine name: GOUKIPRIME
Process information:
Process ID: 7508
Process name: w3wp.exe
Account name: IIS APPPOOL\gouki
Exception information:
Exception type: HttpException
Exception message: A potentially dangerous Request.Path value was detected from the client (?).
at System.Web.HttpRequest.ValidateInputIfRequiredByConfig()
at System.Web.HttpApplication.PipelineStepManager.ValidateHelper(HttpContext context)
Request information:
Request URL: http://gouki.com/Story/?page=8&orderby=views&tagged=&subject=&author=?page=10&orderby=views,views,views,&tagged=,,,,,,,,,,,,&subject=,,,,,,,,,,,,,,,,,,&author=,,,,,,,,,,,,,,
Request path: /Story/?page=8&orderby=views&tagged=&subject=&author=
User host address: 66.249.68.81
User:
Is authenticated: False
Authentication Type:
Thread account name: IIS APPPOOL\gouki
Thread information:
Thread ID: 142
Thread account name: IIS APPPOOL\gouki
Is impersonating: False
Stack trace: at System.Web.HttpRequest.ValidateInputIfRequiredByConfig()
at System.Web.HttpApplication.PipelineStepManager.ValidateHelper(HttpContext context)
Custom event details:
Connection: Keep-alive
Accept: */*
Accept-Encoding: gzip,deflate
From: googlebot(at)googlebot.com
Host: gouki.com
User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)我不确定googlebot在哪里拾取了格式错误的URL (我已经尝试过在我的站点上重现,但没有用),但我更好奇的是,当我自己复制/粘贴URL (继续,尝试)时,为什么会将此异常记录到事件日志中。是的,由于参数值没有任何意义,页面有点损坏,我可以理解为什么双问号会导致问题,但没有抛出异常。我已经尝试将我的用户代理更改为googlebot,但我仍然看不到错误。
出于某种原因,Asp.net MVC看到了第一个?作为路径的一部分,而不是查询字符串的开始,但仅当googlebot请求页面时。
这里有没有一些我在事件日志中看不到的转义?
发布于 2011-12-13 17:18:41
注意这一点:
Request path: /Story/?page=8&orderby=views&tagged=&subject=&author=服务器认为查询字符串参数是页面名称的一部分,这可能意味着第一个问号实际上使用%3f进行了转义,但在错误消息中并没有以这种方式显示。问号作为查询字符串的分隔符有效,但不能作为页面名称的一部分。
机器人已经在某个地方找到了URL,并可能试图修复它。确保您正确地转义了URL,即当URL位于HTML元素的属性中时,&应为&。
如果您的页面中有一个像?page=8&orderby=views&tagged=&subject=&author=这样的相对链接,机器人可能会尝试通过将其与当前页面的URL组合来生成一个完整的URL,这将解释两组查询字符串。这应该是正常的,但是如果URL的转义有一些问题,它可能会把它搞乱。
发布于 2011-12-13 17:02:33
https://stackoverflow.com/questions/8486527
复制相似问题