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

Incorrect resolution of handler mappings - the Allow header has wrong values

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1.2
    • Fix Version/s: Waiting for Triage
    • Component/s: None
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      Sending an OPTIONS request to:

      /api/myobject/count

      The controller defines the following methods:

      @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
      @ResponseStatus(HttpStatus.NO_CONTENT)
      public Privilege deleteOneById{...}
      
      @RequestMapping(method = RequestMethod.GET, value = "/count")
      @ResponseBody
      @ResponseStatus(value = HttpStatus.OK)
      public long count() {...}
      

      The DispatcherServlet - getHandler logic will fail to find a match (since OPTIONS is not mapped) but when calculating the Allow header - both of these 2 methods will be considered a match, and the value of that header will be:

      Allow: GET, DELETE

      When it should just be:

      Allow: GET

      This leads to additional and incorrect values for the Allow header.

        Attachments

          Activity

            People

            • Assignee:
              rstoya05-aop Rossen Stoyanchev
              Reporter:
              eugenparaschiv Eugen Paraschiv
              Last updater:
              Eugen Paraschiv
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                3 years, 27 weeks, 6 days ago