Affects: 6.0.3


Hi folks! I have Spring Cloud Gateway application that consumes HTTP PROPFIND method.

Now I am trying to migrate it from Spring Boot 2 to Spring Boot 3 that in turns upgrading version of spring-webflux from 5.3.22 to 6.0.3 that causes issue:

Original Stack Trace:
        at java.base/java.lang.Enum.valueOf(Enum.java:273)
        at org.springframework.web.bind.annotation.RequestMethod.valueOf(RequestMethod.java:35)
        at org.springframework.web.reactive.result.condition.RequestMethodsRequestCondition.matchRequestMethod(RequestMethodsRequestCondition.java:157)
        at org.springframework.web.reactive.result.condition.RequestMethodsRequestCondition.getMatchingCondition(RequestMethodsRequestCondition.java:135)
        at org.springframework.web.reactive.result.method.RequestMappingInfo.getMatchingCondition(RequestMappingInfo.java:269)
        at org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping.getMatchingMapping(RequestMappingInfoHandlerMapping.java:91)
        at org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping.getMatchingMapping(RequestMappingInfoHandlerMapping.java:63)
        at org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping.addMatchingMappings(AbstractHandlerMethodMapping.java:366)
        at org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping.lookupHandlerMethod(AbstractHandlerMethodMapping.java:328)
        at org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:297)
        at org.springframework.web.reactive.result.method.RequestMappingInfoHandlerMapping.getHandlerInternal(RequestMappingInfoHandlerMapping.java:105)
        at org.springframework.web.reactive.handler.AbstractHandlerMapping.getHandler(AbstractHandlerMapping.java:187)
        at org.springframework.web.reactive.DispatcherHandler.lambda$handle$0(DispatcherHandler.java:150)

So looks like issue has been raised inside org.springframework.web.reactive.result.condition.RequestMethodsRequestCondition#matchRequestMethod. Previously org.springframework.http.HttpMethod was enum and for PROPFIND method argument was null. Now it is a class that can contain any value inside. Therefore it reaches point where it tries to convert org.springframework.http.HttpMethod to org.springframework.web.bind.annotation.RequestMethod that in turns fails with aforementioned exception.

Comment From: sdeleuze

I can reproduce, looks WebFlux specific (WebMvc works fine for the same use case).