From 1d9495d50b09bab2143577653ae0ee6b4bd8a67f Mon Sep 17 00:00:00 2001 From: wb-ldy613915 Date: Fri, 10 Jan 2020 15:33:59 +0800 Subject: [PATCH 1/4] Fix #2285 --- .../src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java b/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java index 85873163c..cb022e4ed 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java @@ -78,6 +78,7 @@ public class DistroFilter implements Filter { if (StringUtils.isBlank(serviceName)) { serviceName = req.getParameter("dom"); } + serviceName = serviceName.trim(); Method method = filterBase.getMethod(req.getMethod(), path); if (method == null) { From 3aa42b60141be961a10fa2e3ef91d4ebb6c97c2e Mon Sep 17 00:00:00 2001 From: lidaoyang Date: Fri, 10 Jan 2020 17:10:34 +0800 Subject: [PATCH 2/4] Revert "Fix #2285" This reverts commit 1d9495d5 --- .../src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java | 1 - 1 file changed, 1 deletion(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java b/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java index cb022e4ed..85873163c 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java @@ -78,7 +78,6 @@ public class DistroFilter implements Filter { if (StringUtils.isBlank(serviceName)) { serviceName = req.getParameter("dom"); } - serviceName = serviceName.trim(); Method method = filterBase.getMethod(req.getMethod(), path); if (method == null) { From ac502b305b9033d163609d670b92fa9bd52b1ba8 Mon Sep 17 00:00:00 2001 From: lidaoyang Date: Fri, 10 Jan 2020 17:11:55 +0800 Subject: [PATCH 3/4] Fix #2285 --- .../src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java b/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java index 85873163c..cb022e4ed 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java @@ -78,6 +78,7 @@ public class DistroFilter implements Filter { if (StringUtils.isBlank(serviceName)) { serviceName = req.getParameter("dom"); } + serviceName = serviceName.trim(); Method method = filterBase.getMethod(req.getMethod(), path); if (method == null) { From 848b1b13494a665ac7fb4e8b7b5421c23618a532 Mon Sep 17 00:00:00 2001 From: lidaoyang Date: Fri, 10 Jan 2020 17:38:21 +0800 Subject: [PATCH 4/4] Fix #2285 --- .../main/java/com/alibaba/nacos/naming/web/DistroFilter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java b/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java index cb022e4ed..db68597da 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java @@ -78,7 +78,9 @@ public class DistroFilter implements Filter { if (StringUtils.isBlank(serviceName)) { serviceName = req.getParameter("dom"); } - serviceName = serviceName.trim(); + if (StringUtils.isNotBlank(serviceName)) { + serviceName = serviceName.trim(); + } Method method = filterBase.getMethod(req.getMethod(), path); if (method == null) {