ASP.NET request validation causes: is there a list?

后端 未结 6 1721
小鲜肉
小鲜肉 2020-12-08 14:26

is anybody aware of a list of exactly what triggers ASP.NET\'s HttpRequestValidationException? [This is behind the common error: \"A potentially dangerous Request.Form value

6条回答
  •  甜味超标
    2020-12-08 15:00

    Try this regular expresson pattern.

    You may need to ecape the \ for javascript ex \\

    var regExpPattern = '[eE][xX][pP][rR][eE][sS][sS][iI][oO][nN]\\(|\\b[oO][nN][a-zA-Z]*\\b\\s*=|&#|<[!/a-zA-Z]|[sS][cC][rR][iI][pP][tT]\\s*:';
    var re = new RegExp("","gi");
    re.compile(regExpPattern,"gi");
    var outString = null;
    outString = re.exec(text);
    

提交回复
热议问题