httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49746] mod_rewrite urlencode option
Date Wed, 25 Aug 2010 17:34:34 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49746

Jason Martin <jhmartin@toger.us> changed:

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

--- Comment #6 from Jason Martin <jhmartin@toger.us> 2010-08-25 13:34:31 EDT ---
I'm sorry, have to reopen again.  Neither int:escape or [B] handle the case
where the original request had a query string, and I now want to package up the
entire original request and pass it in the query string.

Example:

/foo/bar?zed=zee&ivy=true  Should be come
/some/other/url?target=/foo/bar%3Fzed=zee%26ivy=true, or something along those
lines.

With the current mechanisms, the & in the query string is not escaped by either
int:escape or [B] (as there is no way to backreference query_string), meaning
the servlet thinks everything after the first name/value pair is a separate
argument and not part of target.

RewriteMap escape int:escape
RewriteRule /(.*)
/some/url?resource=fibble&target=http://%{HTTP_HOST}/$1?${escape:%{QUERY_STRING}}
[B,PT,L]

(2) init rewrite engine with requested uri /foo/bar
(3) applying pattern '/(.*)' to uri '/foo/bar'
(5) escaping backreference 'foo/bar' to 'foo%2fbar'
(5) map lookup OK: map=escape key=zed=zee&ivy=true -> val=zed=zee&ivy=true
(2) rewrite '/foo/bar' ->
'/some/url?resource=fibble&target=http://127.0.0.1:26080/foo%2fbar?zed=zee&ivy=true'
(3) split
uri=/some/url?resource=fibble&target=http://127.0.0.1:26080/foo%2fbar?zed=zee&ivy=true
-> uri=/some/url,
args=resource=fibble&target=http://127.0.0.1:26080/foo%2fbar?zed=zee&ivy=true
(2) forcing '/some/url' to get passed through to next API URI-to-filename
handler

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message