-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug
Milestone
Description
Javier Antoniucci opened SPR-7946 and commented
At AbstractUrlHandlerMapping.getHandlerInternal (line 210) a HandlerExecutionChain object called chain is created or casted from handler, then mappedInterceptors are added to the chain but the variable scope ends and chain is not assigned to the handler variable.
if (handler != null && this.mappedInterceptors != null) {
Set<HandlerInterceptor> mappedInterceptors =
this.mappedInterceptors.getInterceptors(lookupPath, this.pathMatcher);
if (!mappedInterceptors.isEmpty()) {
HandlerExecutionChain chain;
if (handler instanceof HandlerExecutionChain) {
chain = (HandlerExecutionChain) handler;
}
else {
chain = new HandlerExecutionChain(handler);
}
chain.addInterceptors(mappedInterceptors.toArray(new HandlerInterceptor[mappedInterceptors.size()]));
// handler = chain; ???
}
}
I tried this modification and works for me but may be I'm wrong.
Affects: 3.0.5
Issue Links:
- Consolidate support for HandlerInterceptor and MappedInterceptor types in AbstractHandlerMapping [SPR-8352] #12999 Consolidate support for HandlerInterceptor and MappedInterceptor types in AbstractHandlerMapping
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: bugA general bugA general bug