Skip to content

Reject "/path/**/other" patterns in PathPatternParser #24952

Closed
@kaladhar-mummadi

Description

@kaladhar-mummadi

Issue:

Created 2 mappings as following in the controller, code is in Controller .javaof the attached project.

@GetMapping("/foo/**")
public ResponseEntity getFoo() {}

@GetMapping("/foo/**/bar")
public ResponseEntity getFooBar() {}
  • In webmvc whenever request comes as /foo/1/2/3/bar (as far as last path segment
    is bar) it maps to getFooBar.
  • If bar is not specified ast last path segment then it maps to getFoo. i.e all foo/1, foo/1/2, foo/ab/cd.... maps to getFoo.
  • The issue is in webflux, when I switch to webflux all mappings map to
    getFoo. No matter if path consists of bar in the last path segment.
  • For eg. /foo/ab/cd/bar maps to getFoo instead of getFooBar.

Uploaded the project here , to switch between webflux and webmvc please comment out
appropriate starter dependency in pom.xml.

Repro project here : https://github.com/kaladhar-mummadi/demo-issue

Notes:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions