Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-211

Matching encoded characters from @Path are not correctlyworking

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 1.1.RC2
    • 1.0.2.GA
    • jaxrs
    • None

    Description

      When using @Path expression like:

      @Path("@

      {segment}

      ")

      The path matching will not work as expected since @ is encoded in the generated regex (which is correct) but when computing offsets to advance in path segment matching the decoded form is used.
      This can be easily fixed by replacing this line:

      String currentUri = request.getUri().getMatchedURIs().get(0);
      with
      String currentUri = request.getUri().getMatchedURIs(false).get(0);

      in ResourceMethodRegistry.getResourceInvoker(HttpRequest request, HttpResponse response)

      You can reproduce it by using a path like /prefix/@test/suffix which will resolve /prefix/@test on a resources and /prefix/@test/suffix on a sub resource.
      (Resolving the resource will work but resolving the sub resource will fail)

      Attachments

        Activity

          People

            patriot1burke@gmail.com Bill Burke (Inactive)
            bstefanescu Bogdan Stefanescu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: