From f05961cf079a9ba2efe88e894171e0d7b50b5427 Mon Sep 17 00:00:00 2001 From: Redkale Date: Sun, 3 Jul 2022 23:43:22 +0800 Subject: [PATCH] =?UTF-8?q?@WebServlet=E5=90=88=E5=B9=B6url=EF=BC=8C?= =?UTF-8?q?=E4=BE=8B=E5=A6=82:=20/shop/*,/shop/info=20=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E6=88=90=E4=B8=80=E4=B8=AA=20=20/shop/*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/org/redkale/net/http/Rest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/org/redkale/net/http/Rest.java b/src/main/java/org/redkale/net/http/Rest.java index 392b80b56..a02526a7b 100644 --- a/src/main/java/org/redkale/net/http/Rest.java +++ b/src/main/java/org/redkale/net/http/Rest.java @@ -1449,12 +1449,23 @@ public final class Rest { } } if (defmodulename.isEmpty() || (!pound && entrys.size() <= 2)) { + Set startWiths = new HashSet<>(); for (MappingEntry entry : entrys) { String suburl = (catalog.isEmpty() ? "/" : ("/" + catalog + "/")) + (defmodulename.isEmpty() ? "" : (defmodulename + "/")) + entry.name; if ("//".equals(suburl)) { suburl = "/"; } else if (suburl.length() > 2 && suburl.endsWith("/")) { + startWiths.add(suburl); suburl += "*"; + } else { + boolean match = false; + for (String s : startWiths) { + if (suburl.startsWith(s)) { + match = true; + break; + } + } + if (match) continue; } urlpath += "," + suburl; av1.visit(null, suburl);