Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public void init(FilterConfig filterConfig) {
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) {
try {
if (request instanceof HttpServletRequest) {
String endpoint = ((HttpServletRequest) request).getRequestURI();
String contextPath = ((HttpServletRequest) request).getContextPath();
String endpoint = contextPath + ((HttpServletRequest) request).getServletPath();
HttpServletResponse resp = (HttpServletResponse) response;

if (isDisabled(endpoint)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
chain.doFilter(request, response);
return;
}
endpoint = ((HttpServletRequest) request).getRequestURI();
String contextPath = ((HttpServletRequest) request).getContextPath();
endpoint = contextPath + ((HttpServletRequest) request).getServletPath();
CharResponseWrapper responseWrapper = new CharResponseWrapper(
(HttpServletResponse) response);
chain.doFilter(request, responseWrapper);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ public void init(FilterConfig filterConfig) throws ServletException {
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
FilterChain filterChain) throws IOException, ServletException {
String requestPath = ((HttpServletRequest) servletRequest).getRequestURI();
String contextPath = ((HttpServletRequest) servletRequest).getContextPath();
String requestPath = contextPath + ((HttpServletRequest) servletRequest).getServletPath();
if (chainBaseManager.isLiteNode()
&& !CommonParameter.getInstance().openHistoryQueryWhenLiteFN
&& filterPaths.contains(requestPath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ protected void service(HttpServletRequest req, HttpServletResponse resp)
if (rateLimiter != null) {
acquireResource = rateLimiter.acquire(runtimeData);
}
String url = Strings.isNullOrEmpty(req.getRequestURI())
? MetricLabels.UNDEFINED : req.getRequestURI();
String contextPath = req.getContextPath();
String url = Strings.isNullOrEmpty(req.getServletPath())
? MetricLabels.UNDEFINED : contextPath + req.getServletPath();
try {
resp.setContentType("application/json; charset=utf-8");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public class HttpApiOnPBFTService extends HttpService {
public HttpApiOnPBFTService() {
port = Args.getInstance().getPBFTHttpPort();
enable = isFullNode() && Args.getInstance().isPBFTHttpEnable();
contextPath = "/walletpbft/";
contextPath = "/walletpbft";
}

@Override
Expand Down