Skip to content

When using Spring MVC, unlike other endpoints, controller and REST controller endpoints use Ant path matching #31604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wilkinsona opened this issue Jul 7, 2022 · 5 comments
Assignees
Labels
status: superseded An issue that has been superseded by another type: bug A general bug

Comments

@wilkinsona
Copy link
Member

When we create WebMvcEndpointHandlerMapping we use the path pattern parser from the MVC auto-configuration:

return new WebMvcEndpointHandlerMapping(endpointMapping, webEndpoints, endpointMediaTypes,
corsProperties.toCorsConfiguration(), new EndpointLinksResolver(allEndpoints, basePath),
shouldRegisterLinksMapping, WebMvcAutoConfiguration.pathPatternParser);

However, when we create ControllerEndpointHandlerMapping, we don't pass in a path pattern parser:

return new ControllerEndpointHandlerMapping(endpointMapping, controllerEndpointsSupplier.getEndpoints(),
corsProperties.toCorsConfiguration());

As a result, the default Ant-based path matching will be used. This feels inconsistent. However, there's a risk that changing it will break users controller and rest controller endpoints if they have implementations that rely on some capabilities of the Ant-based matching that the path pattern parser doesn't support. We may decide that we can't do anything about this until 3.0.

@wilkinsona wilkinsona added the for: team-meeting An issue we'd like to discuss as a team to make progress label Jul 7, 2022
@ailjushkin

This comment was marked as off-topic.

@wilkinsona

This comment was marked as off-topic.

@wilkinsona wilkinsona added type: bug A general bug and removed for: team-meeting An issue we'd like to discuss as a team to make progress labels Jul 13, 2022
@wilkinsona wilkinsona added this to the 3.0.x milestone Jul 13, 2022
@mbhave mbhave self-assigned this Jul 13, 2022
@mbhave
Copy link
Contributor

mbhave commented Jul 13, 2022

As of Spring Framework 6.0, this is the default so there isn't any change for boot to make here. This can be verified by pathPatternsCondition not being null. Closing the issue as superseded.

@mbhave mbhave closed this as completed Jul 13, 2022
@mbhave mbhave added the status: superseded An issue that has been superseded by another label Jul 13, 2022
@mbhave mbhave removed this from the 3.0.x milestone Jul 13, 2022
@vpavic
Copy link
Contributor

vpavic commented Jul 14, 2022

It's a bit unclear what has this been superseded by. Is it #31700 or something else?

@wilkinsona
Copy link
Member Author

It's #31700.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants