You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2006/02/07 13:13:43 UTC
DO NOT REPLY [Bug 38550] New: - Setting headers based on proxied data
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38550>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38550
Summary: Setting headers based on proxied data
Product: Apache httpd-2
Version: 2.0-HEAD
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P3
Component: mod_rewrite
AssignedTo: bugs@httpd.apache.org
ReportedBy: apache@rikrose.net
CC: apache@rikrose.net
mod_rewrite can set headers and cookies based on parts of the request. It would
be good if it could set headers and cookies based on part of the response as
well. In the situation where Apache is being used as a (reverse) proxy in front
of another web application server, this allows for greater flexibility in
setting cookies - a very large gain, if the web application acts as a cookie jar.
The easiest way to implement this is to do make the following changes:
- Add a new flag to rules, indicating that the rule should only be run AFTER
content has been returned
- Add a "before/after" flag to apply_rewrite_list.
- In apply_rewrite_list, only run rules with the AFTER flag is the
before/after flag is set. Do not run rules without the AFTER flag if the
before/after flag is not set.
- Add an output filter hook, essentially to run mod_rewrite again, as an
output filter.
- Add the new before/after flag to the calls to apply_rewrite_list. The
original calls to mod_rewrite should all call with the before/after flag set
to "before", and the call(s) in the output filter hooks should all call with
the flag set to "after".
- Edit lookup_header to search for output headers in preference to request
headers. For correctness, a before/after flag should be inserted for this
function, to enable looking for output headers only after the response has
been generated.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 38550] - Setting headers based on proxied data
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38550>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38550
------- Additional Comments From nd@perlig.de 2006-02-07 14:03 -------
mod_rewrite can only set cookies directly, which is already just a side effect
of the actual task of mod_rewrite - rewriting of incoming URLs. The only other
header which can be set, but only implicitly, is Vary.
I don't think that your suggestion is a good idea. If you want to set headers,
mod_headers is the better choice.
May I ask, what your actual task is?
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
DO NOT REPLY [Bug 38550] - Setting headers based on proxied data
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38550>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=38550
------- Additional Comments From apache@rikrose.net 2006-02-08 17:36 -------
mod_headers is indeed the correct place to do so, but it's also a far more
difficult place to do so, because mod_headers can not read an existing value to
assign it elsewhere - it can only assign values from the config file. In order
to (want to) use mod_headers the code to read existing headers and cookies to
use as values, like mod_rewrite's %{HTTP_foo} etc would need to be added.
The easiest way to think about what I'm doing is that I'm setting a cookie for
the browser after an application that acts as a cookie jar - think sneaking a
cookie past an anonymising proxy, by disguising it in a header, and rewriting it
back.
I agree, in principal, mod_rewrite is a completely stupid place to do this hack.
On the other hand, it's a very very easy place to do it, as all of the support
code is in place.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org