gpt4 book ai didi

asp.net-mvc-3 - 从客户端检测到潜在危险的 Request.Form 值 (wresult ="
转载 作者:行者123 更新时间:2023-12-03 14:41:02 25 4
gpt4 key购买 nike

使用 WIF 时,我也收到请求验证错误。我被正确发送到 STS,但在返回的路上,我收到此验证错误。

我遵循了所有说明。

<httpRuntime  requestValidationMode="2.0" />

查看!
    [ValidateInput(false)]

查看!
<pages validateRequest="false" >

查看!

我尝试了自定义验证器,但它从未被实例化。

错误堆栈:
[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (wresult="trust:RequestSecuri...").]
System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) +11396740
System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, RequestValidationSource requestCollection) +82
System.Web.HttpRequest.get_Form() +212
Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.IsSignInResponse(HttpRequest request) +26
Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.CanReadSignInResponse(HttpRequest request, Boolean onPage) +145
Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs args) +108
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270

有什么建议?

最佳答案

<httpRuntime requestValidationMode="2.0"/>

在此添加之后
<configuration>
<system.web>
<pages validateRequest="false" />
</system.web>
</configuration>

同样在 mvc3 中有一个 AllowHtml 属性
[AllowHtml]
public string Property{ get; set; }

这里有一些有用的链接

ASP.NET MVC – pages validateRequest=false doesn’t work?

Why is ValidateInput(False) not working?

关于asp.net-mvc-3 - 从客户端检测到潜在危险的 Request.Form 值 (wresult ="<trust:RequestSecuri..."),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7614978/

25 4 0

Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com