From 849ad711058b0a553e6192bae31e3fb0fb8daec8 Mon Sep 17 00:00:00 2001 From: nisiyong Date: Mon, 28 Sep 2020 11:16:02 +0800 Subject: [PATCH] fix: adapt to the scenario that the ConfigService sets context-path (#3316) --- .../configservice/filter/ClientAuthenticationFilter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/filter/ClientAuthenticationFilter.java b/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/filter/ClientAuthenticationFilter.java index dad62880138..b672b3c1e7b 100644 --- a/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/filter/ClientAuthenticationFilter.java +++ b/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/filter/ClientAuthenticationFilter.java @@ -64,9 +64,9 @@ public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain } // check signature - String path = request.getServletPath(); + String uri = request.getRequestURI(); String query = request.getQueryString(); - if (!checkAuthorization(authorization, availableSecrets, timestamp, path, query)) { + if (!checkAuthorization(authorization, availableSecrets, timestamp, uri, query)) { logger.warn("Invalid authorization. appId={},authorization={}", appId, authorization); response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized"); return;