diff --git a/concurrency-limits-servlet-jakarta/src/main/java/com/netflix/concurrency/limits/servlet/jakarta/ServletLimiterBuilder.java b/concurrency-limits-servlet-jakarta/src/main/java/com/netflix/concurrency/limits/servlet/jakarta/ServletLimiterBuilder.java index f400bb51..99057eac 100644 --- a/concurrency-limits-servlet-jakarta/src/main/java/com/netflix/concurrency/limits/servlet/jakarta/ServletLimiterBuilder.java +++ b/concurrency-limits-servlet-jakarta/src/main/java/com/netflix/concurrency/limits/servlet/jakarta/ServletLimiterBuilder.java @@ -71,7 +71,7 @@ public ServletLimiterBuilder partitionByParameter(String name) { * @return Chainable builder */ public ServletLimiterBuilder partitionByPathInfo(Function pathToGroup) { - return partitionResolver(request -> Optional.ofNullable(request.getPathInfo()).map(pathToGroup).orElse(null)); + return partitionResolver(request -> Optional.ofNullable(request.getServletPath()).map(pathToGroup).orElse(null)); } /** @@ -129,7 +129,7 @@ public ServletLimiterBuilder bypassLimitByParameter(String name, String value) { * @return Chainable builder */ public ServletLimiterBuilder bypassLimitByPathInfo(String pathInfo) { - return bypassLimitResolver((context) -> pathInfo.equals(context.getPathInfo())); + return bypassLimitResolver((context) -> pathInfo.equals(context.getServletPath())); } /** diff --git a/concurrency-limits-servlet-jakarta/src/test/java/com/netflix/concurrency/limits/ConcurrencyLimitServletFilterTest.java b/concurrency-limits-servlet-jakarta/src/test/java/com/netflix/concurrency/limits/ConcurrencyLimitServletFilterTest.java index 701a9a9e..4621155a 100644 --- a/concurrency-limits-servlet-jakarta/src/test/java/com/netflix/concurrency/limits/ConcurrencyLimitServletFilterTest.java +++ b/concurrency-limits-servlet-jakarta/src/test/java/com/netflix/concurrency/limits/ConcurrencyLimitServletFilterTest.java @@ -119,7 +119,7 @@ public void testDoFilterBypassCheckPassedForPath() throws ServletException, IOEx MockHttpServletRequest request = new MockHttpServletRequest(); request.setMethod("POST"); - request.setPathInfo("/admin/health"); + request.setServletPath("/admin/health"); MockHttpServletResponse response = new MockHttpServletResponse(); MockFilterChain filterChain = new MockFilterChain(); diff --git a/concurrency-limits-servlet-jakarta/src/test/java/com/netflix/concurrency/limits/GroupServletLimiterTest.java b/concurrency-limits-servlet-jakarta/src/test/java/com/netflix/concurrency/limits/GroupServletLimiterTest.java index 24ed04b2..46196d1f 100644 --- a/concurrency-limits-servlet-jakarta/src/test/java/com/netflix/concurrency/limits/GroupServletLimiterTest.java +++ b/concurrency-limits-servlet-jakarta/src/test/java/com/netflix/concurrency/limits/GroupServletLimiterTest.java @@ -166,7 +166,7 @@ private HttpServletRequest createMockRequestWithPrincipal(String name) { private HttpServletRequest createMockRequestWithPathInfo(String name) { HttpServletRequest request = Mockito.mock(HttpServletRequest.class); - Mockito.when(request.getPathInfo()).thenReturn(name); + Mockito.when(request.getServletPath()).thenReturn(name); return request; } }