diff --git a/api-portal/src/main/java/com/jmsoftware/apiportal/universal/filter/JwtAuthenticationFilter.java b/api-portal/src/main/java/com/jmsoftware/apiportal/universal/filter/JwtAuthenticationFilter.java index d8dce716..cc6356fb 100644 --- a/api-portal/src/main/java/com/jmsoftware/apiportal/universal/filter/JwtAuthenticationFilter.java +++ b/api-portal/src/main/java/com/jmsoftware/apiportal/universal/filter/JwtAuthenticationFilter.java @@ -51,14 +51,14 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter { protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { log.info("JWT authentication is filtering [{}] client requested access. URL: {}, HTTP method: {}", - RequestUtil.getRequestIpAndPort(request), request.getServletPath(), request.getMethod()); + RequestUtil.getRequestIpAndPort(request), request.getRequestURL(), request.getMethod()); if (customConfiguration.getWebSecurityDisabled()) { log.warn("The web security is disabled! Might face severe web security issue."); filterChain.doFilter(request, response); return; } if (checkIgnores(request)) { - log.info("The request can be ignored. URL: {}", request.getRequestURI()); + log.info("The request can be ignored. URL: {}", request.getRequestURL()); filterChain.doFilter(request, response); return; } diff --git a/api-portal/src/main/java/com/jmsoftware/apiportal/universal/filter/RequestFilter.java b/api-portal/src/main/java/com/jmsoftware/apiportal/universal/filter/RequestFilter.java deleted file mode 100644 index 9de8a041..00000000 --- a/api-portal/src/main/java/com/jmsoftware/apiportal/universal/filter/RequestFilter.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.jmsoftware.apiportal.universal.filter; - -import com.jmsoftware.common.util.RequestUtil; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; -import org.springframework.web.filter.OncePerRequestFilter; - -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - *

RequestFilter

- *

Request filter.

- * - * @author Johnny Miller (鍾俊), email: johnnysviva@outlook.com - * @date 2019-03-23 14:24 - **/ -@Slf4j -@Component -public class RequestFilter extends OncePerRequestFilter { - @Override - @SuppressWarnings("NullableProblems") - protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, - FilterChain filterChain) throws IOException, ServletException { - log.info("[{}] Client requested access. Method: {}, URL: {}", - RequestUtil.getRequestIpAndPort(request), - request.getMethod(), - request.getRequestURL()); - filterChain.doFilter(request, response); - } -}