我有一个行动
[HttpPost]
[ValidateInput(false)]
public ActionResult Foo()
{
var module = FederatedAuthentication.WSFederationAuthenticationModule;
// exception in the line bellow
if (module.CanReadSignInResponse(System.Web.HttpContext.Current.Request, true))
{
}
}
当我调用该方法时,它会抛出一个异常,说明该请求具有潜在危险。我们在帖子上发送一个 XML。
堆栈跟踪:

即使使用操作上的属性[ValidateInput(false)],也会发生此异常。
知道为什么会这样吗?有没有办法防止它?