Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-15264

PathPatternParser matches root path against path variable

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0 M5
    • Fix Version/s: 5.0 M5
    • Component/s: Reactive, Web
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      The PathPatternParser will match the pattern "/{foo}" against the path "/". This is a regression: the AntPathMatcher will not match with the same parameters.

      The rationale: path/URI template variables (i.e. patterns with curly braces) should be considered required, and not optional. In that sense, they cannot be considered the same as wildcard matches (i.e. "/*" should match the path "/", but "/{foo}" should not). If they would be optional, we could not resolve the @PathVariable parameters in a @RequestMapping method.

        Attachments

          Activity

            People

            Assignee:
            aclement Andy Clement
            Reporter:
            arjen.poutsma Arjen Poutsma
            Last updater:
            Spring Issues Spring Issues
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 29 weeks, 6 days ago