角http请求 - 从客户端(:)中检测到有潜在危险的Request的价值 [英] A potentially dangerous Request.Path value was detected from the client (:) - angular http request

查看:222
本文介绍了角http请求 - 从客户端(:)中检测到有潜在危险的Request的价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从客户端检测到有潜在危险的Request的值(:)。

A potentially dangerous Request.Path value was detected from the client (:).

说明:在当前Web请求的执行过程中发生未处理的异常。请查看有关错误的详细信息的堆栈跟踪以及它起源于code。

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

异常详细信息:System.Web.HttpException:(:)从客户端检测到有潜在危险的Request的值。

Exception Details: System.Web.HttpException: A potentially dangerous Request.Path value was detected from the client (:).

源错误:

当前Web请求的执行过程中生成了未处理的异常。可以使用异常堆栈跟踪下面确定有关异常原因和位置信息。

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

堆栈跟踪:

[HttpException(0x80004005的):从客户端(:)中检测到有潜在危险的Request的价值] System.Web.Htt prequest.ValidateInputIfRequiredByConfig()9560004 System.Web.PipelineStepManager.ValidateHelper(HttpContext的上下文)+53

[HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (:).] System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +9560004 System.Web.PipelineStepManager.ValidateHelper(HttpContext context) +53

我的code:

 public List<GetPlayersSiteGoalViewModel> GetPlayers(string teamUrl)
 {
     var playersSiteGoal = new List<GetPlayersSiteGoalViewModel>();
     return playersSiteGoal;
 }

角服务方法:

 dataBaseService.getPlayers = function (param) {
                return $http({
                    method: 'GET',
                    url: getBaseUrl() + dataBaseService.apiController + '/GetPlayers/' + param.TeamUrl
                });
            };

更新:

param.TeamUrl

http://www.goal.com/en-us/teams/italy/juventus/1242?ICID=SP_TN_82

我该如何解决这个问题?

How do I fix this?

推荐答案

我觉得这里的答案可能会有所帮助:<一href=\"http://stackoverflow.com/questions/14475913/url-routing-image-handler-a-potentially-dangerous-request-path-value\">URL路由,图像处理程序和放大器; &QUOT;有潜在危险的Request的价值和QUOT;

I think the answer here may be of some help: URL Routing, Image Handler & "A potentially dangerous Request.Path value"

看起来由ASP.NET标记为您的网址无效字符。

It looks like ? is marked by ASP.NET as an invalid character in your URL.

修改

回去和重新阅读错误信息,它看起来像是问题的根源。虽然我没有看到它在你传递的网址,它看起来是越来越添加到URL的地方(也许 getBaseUrl()?)。即使你解决这个问题,我想你会得到与另一个错误?根据通过链接问题的答案提供无效的名单上。

Going back and re-reading the error message, it looks like : is the source of your problem. While I don't see it in the url you pass, it looks like it is getting added to the url somewhere (maybe by getBaseUrl()?). Even if you fix that, I assume you would get another error with ? based on the invalid list supplied by the answer in the linked question.

编辑2

您可以通过添加修正:和?在&lt;保证web.config文件中的httpRuntime requestPathInvalidCharacters 属性作为链接显示,或做什么斯科特Hanselman的显示了在这个问题的答案底部的链接:<一个href=\"http://www.hanselman.com/blog/ExperimentsInWackinessAllowingPercentsAnglebracketsAndOtherNaughtyThingsInTheASPNETIISRequestURL.aspx\" rel=\"nofollow\">http://www.hanselman.com/blog/ExperimentsInWackinessAllowingPercentsAnglebracketsAndOtherNaughtyThingsInTheASPNETIISRequestURL.aspx

You can fix it by either adding : and ? to the <httpRuntime requestPathInvalidCharacters property of the web.config as that link shows, or do what Scott Hanselman shows in the link at the bottom of that answer: http://www.hanselman.com/blog/ExperimentsInWackinessAllowingPercentsAnglebracketsAndOtherNaughtyThingsInTheASPNETIISRequestURL.aspx

这篇关于角http请求 - 从客户端(:)中检测到有潜在危险的Request的价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆