I am using a different management port with management.server.base-path: '/management' and management.endpoints.web.base-path: '/'.
When setting up security as .requestMatchers(EndpointRequest.toLinks()).permitAll(), then performing a request over '/management/', returns 403
Root cause:
WebEndpointProperties.setBasePath cleans '/' as ''.
Later on, upon first '/' call, LinksRequestMatcher sees the empty basepath and returns EndpointRequest.EMPTY_MATCHER, which always evaluates to false