在ASP.NET MVC中,我们可以使用一种特殊的注释来告诉AntiXssEncoder不要对某些代码片段进行编码。这个注释是'[System.Web.Mvc.AllowHtml]”,它可以放在控制器参数或模型属性上。例如,我们可以把以下代码放在模型属性上:
public class MyModel
{
[AllowHtml]
public string MyHtml { get; set; }
}
这样,在控制器中如果我们使用了这个模型,AntiXssEncoder就会跳过对'MyHtml”的编码,从而解决Data URI的二次编码问题。
上一篇:antix更换debian源
下一篇:按T键时,Pygame没有响应。