Jetty
  1. Jetty
  2. JETTY-1390

Rewrite handler does not handle encoded URIs correctly

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.1.26
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      1> Configure the RewriteHandler in jetty.xml as follows.

      <Set name="handler">
      <New id="Handlers"
      class="org.mortbay.jetty.handler.rewrite.RewriteHandler">
      <Set name="rewriteRequestURI">true</Set>
      <Set name="rewritePathInfo">false</Set>
      <Set name="originalPathAttribute">requestedPath</Set>
      <Call name="addRule"><Arg><New
      class="org.mortbay.jetty.handler.rewrite.MsieSslRule"/></Arg></Call>
      <!-- map convenience URLs to the webapp that handles them -->
      <Call
      name="addRewriteRule"><Arg>/foo/*</Arg><Arg>/service/foo</Arg></Call>
      </New>
      </Set>

      2> Configure a Servlet to handle requests sent to /service/foo

      3> Send the request as http://<host>:<port>/service/foo/a%2Fb
      request.getRequestURI() on the Servlet returns "/service/foo/a%2Fb".
      This is correct.

      4> Send the request as http://<host>:<port>/foo/a%2Fb
      request.getRequestURI() on the Servlet returns "/service/foo/a/b".
      This is wrong, it should be "/service/foo/a%2Fb

        Activity

        Hide
        Michael Gorovoy added a comment -

        I have confirmed that this problem still exists in Jetty v6.1.26, but doesn't exist in Jetty v7.4.5

        Show
        Michael Gorovoy added a comment - I have confirmed that this problem still exists in Jetty v6.1.26, but doesn't exist in Jetty v7.4.5
        Hide
        Michael Gorovoy added a comment -

        It appears that there has been an attempt to fix this issue in r6687 that did not make any changes except for VERSION.txt.

        Show
        Michael Gorovoy added a comment - It appears that there has been an attempt to fix this issue in r6687 that did not make any changes except for VERSION.txt.
        Hide
        Michael Gorovoy added a comment -

        Committed r6741

        Show
        Michael Gorovoy added a comment - Committed r6741

          People

          • Assignee:
            Michael Gorovoy
            Reporter:
            Greg Wilkins
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: