https://bz.apache.org/bugzilla/show_bug.cgi?id=60116

            Bug ID: 60116
           Summary: NC matches in the Rewrite Valve cause matched groups
                    to be lower case.
           Product: Tomcat 8
           Version: 8.5.x-trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: sebs...@sebster.com

I have the following rewrite rule:

RewriteCond %{REQUEST_URI} /test
RewriteCond %{QUERY_STRING}
.*a=([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}).* [NC]
RewriteRule .* - [E=X-Tenant-Id:%1,L]

This matches the query string to the supplied pattern in a case insensitive
way. However, the back reference %1 is always lower case, independent of the
actual query string. That is, if the query string is:

    http://localhost:8080/test?a=CFA2AFDF-5D36-4D1F-B798-430557CF4355

the matched back reference %1 is cfa2afdf-5d36-4d1f-b798-430557cf4355.

This is strange and unexpected. It is also not how NC works in The Apache HTTP
server mod_rewrite, which just does the test in a case insensitive way but
returns the actual matched group. Case insensitive Java regular expressions
also do not change the case of any of the matched groups.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to