I tried to do this as part of #31547 but reverted the endpoint specific changes because the changes were bigger than expected. The handler mappings support both path pattern and string based matching with path pattern used by the auto-configuration. In case of String-based matching, trailing slashes are supported but that does not seem to be the case with pattern based matching. As part of this issue, we need to do the following:

  • Drop support for String based matching for actuator endpoints
  • Consider whether to support trailing slash for actuator endpoints with pattern matching
  • AbstractWebMvcEndpointHandlerMapping no longer needs to be a MatchableHandlerMapping (this was added to support Spring Security's MvcRequestMatcher but it can do that now without it being a MatchableHandlerMapping).

Comment From: wilkinsona

There may be some overlap between this issue and https://github.com/spring-projects/spring-boot/issues/31604.