ApiTesterFilter 개선 및 KJBank 흔적 제거
- "/api/call-api" 경로 필터링 로직 추가 - KJBank 관련 문자열 DJBank로 변경
This commit is contained in:
@@ -56,7 +56,12 @@ public class ApiTesterFilter implements Filter {
|
|||||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||||
HttpServletRequest httpServletRequest = (HttpServletRequest) request;
|
HttpServletRequest httpServletRequest = (HttpServletRequest) request;
|
||||||
|
|
||||||
if (httpServletRequest.getRequestURI().contains("/api/call-api")) {
|
// "/api/call-api" 경로가 아닌 경우 필터링하지 않고 다음 필터로 넘어감
|
||||||
|
if (!httpServletRequest.getRequestURI().contains("/api/call-api")) {
|
||||||
|
chain.doFilter(request, response);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ApiService apiSpecInfoDtoService = ApplicationContextUtil.getContext().getBean(ApiService.class);
|
ApiService apiSpecInfoDtoService = ApplicationContextUtil.getContext().getBean(ApiService.class);
|
||||||
String url = httpServletRequest.getHeader("original-url");
|
String url = httpServletRequest.getHeader("original-url");
|
||||||
|
|
||||||
@@ -81,7 +86,7 @@ public class ApiTesterFilter implements Filter {
|
|||||||
String scope = params.getOrDefault("scope", "default");
|
String scope = params.getOrDefault("scope", "default");
|
||||||
|
|
||||||
String token = "{\n" +
|
String token = "{\n" +
|
||||||
" \"access_token\": \"kjbank_gw_sample_token\",\n" +
|
" \"access_token\": \"djbank_gw_sample_token\",\n" +
|
||||||
" \"token_type\": \"bearer\",\n" +
|
" \"token_type\": \"bearer\",\n" +
|
||||||
" \"expires_in\": 86400,\n" +
|
" \"expires_in\": 86400,\n" +
|
||||||
" \"scope\": \""+scope +"\",\n" +
|
" \"scope\": \""+scope +"\",\n" +
|
||||||
@@ -145,9 +150,6 @@ public class ApiTesterFilter implements Filter {
|
|||||||
response.getWriter().println(responseStr);
|
response.getWriter().println(responseStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
chain.doFilter(request, response);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user