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 2020/06/04 04:37:38 UTC
[Bug 64495] New: Rewrite rule threadlocal issue
https://bz.apache.org/bugzilla/show_bug.cgi?id=64495
Bug ID: 64495
Summary: Rewrite rule threadlocal issue
Product: Tomcat 9
Version: 9.0.35
Hardware: PC
OS: Mac OS X 10.1
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: dev@tomcat.apache.org
Reporter: melvindoss@gmail.com
Target Milestone: -----
Hi,
I am using Rewrite Valve in my server with rewrite.config in the right
location. It was working fine. I recently upgraded from 9.0.34 to 9.0.35. I
found an issue with Rewrite rule matching.
Digging into the code I found the following,
https://github.com/apache/tomcat/commit/c4b71e31f3183ce3f4b8e86bd2cef49393a2a7e5#diff-2dc33ffdb9d224258577902518d5bfdc
In this particular commit the pattern variable for RewriteRule is made as
static. Because of this the first rule declared in rewrite.config is assigned
to this variable and all other RewriteRule's pattern are ignored.
Steps to reproduce:
In rewrite config declare two rules say,
RewriteRule ^/url1/(.*)$ /rewrittenurl1/$1 [L]
RewriteRule ^/url2/(.*)$ /rewrittenurl2/$1 [L,QSA]
Now give a request matching second rule i.e <domain>/url2/some/path. It will
try to math the url with pattern ^/url1/(.*)$ as the pattern variable is static
and is assigned with first RewriteRule parsed.
Additional request:
I am just curious to know why pattern is declared as a ThreadLocal instead of a
private variable.
Regards,
Melvin
--
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 64495] Rewrite rule threadlocal issue
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=64495
Felix Schumacher <fe...@internetallee.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|NEW |RESOLVED
--- Comment #1 from Felix Schumacher <fe...@internetallee.de> ---
*** This bug has been marked as a duplicate of bug 64432 ***
--
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