You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2016/09/12 07:08:46 UTC

[Bug 60116] New: NC matches in the Rewrite Valve cause matched groups to be lower case.

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: sebster@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 60116] NC matches in the Rewrite Valve cause matched groups to be lower case.

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60116

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
This has been fixed in the following branches:
- 9.0.x for 9.0.0.M11 onwards
- 8.5.x for 8.5.6 onwards
- 8.0.x for 8.0.38 onwards

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

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