Skip to content

Commit 07b0fa1

Browse files
committed
doFilterNestedErrorDispatch delegates to filter chain
Closes: gh-23596
1 parent 6eb0e9e commit 07b0fa1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

spring-web/src/main/java/org/springframework/web/filter/OncePerRequestFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ protected abstract void doFilterInternal(
247247
protected void doFilterNestedErrorDispatch(HttpServletRequest request, HttpServletResponse response,
248248
FilterChain filterChain) throws ServletException, IOException {
249249

250-
doFilter(request, response, filterChain);
250+
filterChain.doFilter(request, response);
251251
}
252252

253253
}

spring-web/src/test/java/org/springframework/web/filter/OncePerRequestFilterTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package org.springframework.web.filter;
1717

1818
import java.io.IOException;
19+
1920
import javax.servlet.DispatcherType;
2021
import javax.servlet.FilterChain;
2122
import javax.servlet.ServletException;
@@ -31,7 +32,6 @@
3132
import org.springframework.mock.web.test.MockHttpServletResponse;
3233
import org.springframework.web.util.WebUtils;
3334

34-
import static org.junit.Assert.assertEquals;
3535
import static org.junit.Assert.assertFalse;
3636
import static org.junit.Assert.assertTrue;
3737

@@ -184,9 +184,10 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
184184

185185
@Override
186186
protected void doFilterNestedErrorDispatch(HttpServletRequest request, HttpServletResponse response,
187-
FilterChain filterChain) {
187+
FilterChain filterChain) throws ServletException, IOException {
188188

189189
this.didFilterNestedErrorDispatch = true;
190+
super.doFilterNestedErrorDispatch(request, response, filterChain);
190191
}
191192
}
192193

0 commit comments

Comments
 (0)