Skip to content

WebFlux.fn puts wrong type of HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE [SPR-17395] #21928

@spring-projects-issues

Description

@spring-projects-issues

Toshiaki Maki opened SPR-17395 and commented

#21635 introduced RouterFunctions.MATCHING_PATTERN_ATTRIBUTE to WebFlux.fn, and set that mapping information as a String. #21900 duplicated that same information in HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE with the same type, whereas it is expected to be of type PathPattern,

attributes.put(BEST_MATCHING_HANDLER_ATTRIBUTE, handlerFunction);
String matchingPattern =
(String) attributes.get(RouterFunctions.MATCHING_PATTERN_ATTRIBUTE);
if (matchingPattern != null) {
attributes.put(BEST_MATCHING_PATTERN_ATTRIBUTE, matchingPattern);

As a result, ClassCastException occurs after updating to Spring Boot 2.1.0.RC1 as Boot expects it as PathPattern

https://github.com/spring-projects/spring-boot/blob/v2.1.0.RC1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/WebFluxTags.java#L97-L98


Affects: 5.1.1

Issue Links:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions