Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-11951

Uri matching does not match request type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.20.0
    • 2.19.4, 2.20.1, 2.21.0
    • camel-http-common
    • None
    • camel-spring, camel-jetty
      OS - RHEL

    • Unknown

    Description

      I had previously described the problem here:
      https://stackoverflow.com/questions/46936348/apache-camel-rest-dsl-405-method-not-allowed

      It appears that the problem is down to a possible bug in the way URIs are matched (not to mention my rather obscure use-case)

      I have a number of REST-DSL endpoints with the same URI but different request types (POST, PUT, GET, DELETE). In my case, the URI is getting selected by
      HttpServletResolveConsumerStrategy.resolve (in addition to these, I have some specific endpoints with wildcards in them)

      This method matches the URI, but not the request type. When I send a GET request, it returns the first consumer candidate it finds which, in my case, always seems to be PUT. Later, when CamelContinuationServlet.doService checks that the request type and cadidate type match, they don't. It then returns 405 Method Not Allowed.

      I believe that the HttpServletResolveConsumerStrategy.resolve method IN camel-hhtp-common should check the request type as well as the URI.

      Attachments

        1. camel-bug-demo.zip
          10 kB
          Robert Hillier

        Activity

          People

            davsclaus Claus Ibsen
            robert.hillier Robert Hillier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: