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 2018/09/07 08:16:19 UTC

[Bug 62688] New: RewriteMap with custom map function does not work

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

            Bug ID: 62688
           Summary: RewriteMap with custom map function does not work
           Product: Tomcat 9
           Version: 9.0.x
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: post@itassist.no
  Target Milestone: -----

Created attachment 36135
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36135&action=edit
Complete jar file for EPSMapPage Map function is attached, pagetypes.txt,
rewrite.config file and the EPSMapPage.java file

RewriteMap with custom map function does not work. We have tested quite heavily
on two different Linux servers. It seems like the map does not read the input
key. What RewriteRule actually sends is the the result of the match of the
RewriteRule as key into the map.

Input file to map:
pagetypes.txt:
p PAGE
a ARTICLE
c CATEGORY
s SEARCH

Example of our test:
RewriteMap pagetypes org.apache.catalina.valves.rewrite.EPSMapPage
pagetypes.txt
RewriteRule .* ${pagetypes:s}

Then we type this URL in browser:
https://test2.tomcat.dev/p

Expected result is that is should try to redirect to this URL internally:
https://test2.tomcat.dev/PAGE

In this case RewriteRule sends in /p to the map pagetypes, but it should send
in letter s.

Complete jar file for EPSMapPage Map function is attached, pagetypes.txt,
rewrite.config file and the EPSMapPage.java file.

-- 
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 62688] RewriteMap with custom map function does not work

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

ITASSIST <po...@itassist.no> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #2 from ITASSIST <po...@itassist.no> ---
We have tested this very carefully on version 9.0.12 and if we use a variable
inside rewritemap inside a rewriterule we get a different behaviour than
before. Before in version 9.0.11 it did not give any error. It did just not
pick up the variable. When we use it now, it does abviously a syntax check and
claims that variable written in the rewrite rule is invalid. For us it seems
like the parser of this does not understand this syntax: 

RewriteRule .* ${portals:%{HTTP_HOST}}

Gives in catalin.oput startup file:
Caused by: java.lang.IllegalArgumentException: %{HTTP_HOST

portals is a rewritemap type and we have tested that it works if we replace the
%{HTTP_HOST} variable with a hardcoded value, it works correct.

-- 
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 62688] RewriteMap with custom map function does not work

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

Remy Maucherat <re...@apache.org> changed:

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

--- Comment #3 from Remy Maucherat <re...@apache.org> ---
I'm opening a new BZ, as this is a different issue.

-- 
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 62688] RewriteMap with custom map function does not work

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

Remy Maucherat <re...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED
           Severity|critical                    |major

--- Comment #1 from Remy Maucherat <re...@apache.org> ---
I added a test to the testsuite and it works with a static key. Please
investigate this further (using the latest Tomcat build, which is now 9.0.12
since as you know some map issues were resolved there).
Please mention the product version when filing a bug, and also use a sensible
severity level.

-- 
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