From b0e594a82b7b5c269bdcad30fcc4a8dfe001b337 Mon Sep 17 00:00:00 2001 From: aoshiguchen <1052045476@qq.com> Date: Wed, 12 Oct 2022 17:19:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0client=E6=89=93=E5=8C=85?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E4=BC=98=E5=8C=96http=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/web/router/DefaultHttpRouter.java | 1 + neutrino-proxy-client/pom.xml | 42 ++++++++++++++++--- .../rest/interceptor/VisitLogInterceptor.java | 4 +- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/neutrino-core/src/main/java/fun/asgc/neutrino/core/web/router/DefaultHttpRouter.java b/neutrino-core/src/main/java/fun/asgc/neutrino/core/web/router/DefaultHttpRouter.java index 95f14886..7d63ce47 100644 --- a/neutrino-core/src/main/java/fun/asgc/neutrino/core/web/router/DefaultHttpRouter.java +++ b/neutrino-core/src/main/java/fun/asgc/neutrino/core/web/router/DefaultHttpRouter.java @@ -234,6 +234,7 @@ public class DefaultHttpRouter implements HttpRouter { if (null != staticResource && CollectionUtil.notEmpty(staticResource.getLocations())) { for (String location : staticResource.getLocations()) { String path = location + httpRouteParam.getUrl(); + path = path.replaceAll("//", "/"); if (path.endsWith("/")) { path += "index.html"; } diff --git a/neutrino-proxy-client/pom.xml b/neutrino-proxy-client/pom.xml index 575e0c1e..5bd9af42 100644 --- a/neutrino-proxy-client/pom.xml +++ b/neutrino-proxy-client/pom.xml @@ -21,24 +21,54 @@ + + + + + + + + + + + + + + + + + + + + - ${artifactId} - org.springframework.boot - spring-boot-maven-plugin - 2.1.3.RELEASE + maven-assembly-plugin - fun.asgc.neutrino.proxy.client.ProxyClient + false + ${artifactId} + + + + fun.asgc.neutrino.proxy.client.ProxyClient + + + + jar-with-dependencies + + make-assembly + package - repackage + single + diff --git a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/base/rest/interceptor/VisitLogInterceptor.java b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/base/rest/interceptor/VisitLogInterceptor.java index 14025332..64fc6be2 100644 --- a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/base/rest/interceptor/VisitLogInterceptor.java +++ b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/base/rest/interceptor/VisitLogInterceptor.java @@ -41,7 +41,9 @@ public class VisitLogInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpRequestWrapper requestParser, HttpResponseWrapper responseWrapper, String route, Method targetMethod) throws Exception { - SystemContextHolder.getContext().setReceiveTime(new Date()); + if (null != SystemContextHolder.getContext()) { + SystemContextHolder.getContext().setReceiveTime(new Date()); + } return true; }