WebServlet.value带.不视为正则表达式

This commit is contained in:
Redkale
2018-12-21 10:38:37 +08:00
parent c9d099c694
commit b7ce390c33

View File

@@ -152,7 +152,7 @@ public class HttpPrepareServlet extends PrepareServlet<String, HttpContext, Http
if (forbidURIMaps != null && forbidURIMaps.containsKey(urlreg)) return false;
if (forbidURIMaps == null) forbidURIMaps = new HashMap<>();
String mapping = urlreg;
if (Utility.contains(mapping, '.', '*', '{', '[', '(', '|', '^', '$', '+', '?', '\\')) { //是否是正则表达式))
if (Utility.contains(mapping, '*', '{', '[', '(', '|', '^', '$', '+', '?', '\\')) { //是否是正则表达式))
if (mapping.endsWith("/*")) {
mapping = mapping.substring(0, mapping.length() - 1) + ".*";
} else {