I had a similar problem with mod_prox and mod_headers for Apache httpd
2.2 today, and I would expect, that changing the headers with mod_header
does not work.
I see no easy way (but maybe others out there). You could hack
ajp_unmarshal_response() in common/jk_ajp_common.c.
Alternative: experiment with a servlet filter for Tomcat. You can always
add filters to webapps without changing or even having the webapp code
itself.
Regards,
Rainer
Richard Kaye wrote:
Hi
I am using Tomcat5.5, Apache2.2 and mod_jk1.2
and a third-part servlet which I can't re-program or
configure.
I need to sniff the HTTP "User-Agent" and/or "Accept"
fields and change the content-type
(currently "text/html;charset=UTF-8") that the
servlet returns based on these.
using mod_headers and mod_setenvif, I currently
have (in my apache2 config) something like:
SetEnvIf User-Agent Whatever DETECTED1
SetEnvIf Accept Somethingelse DETECTED2
JkMount /servletname/* ajp13_worker
<LocationMatch /servletname/* >
Header set Content-Type "text/xml" env=DETECTED1
Header set Content-Type "application/xml" env=DETECTED2
</LocationMatch>
Unfortunately, it doesn't work. Specifically, I always get the
document served as "Content-Type: text/html;charset=UTF-8"
and not "Content-Type: text/xml" as expected. From googling a bit
I have learnt that the mod_headers module won't set the Content-Type
header, because this one is set internally by apache at a later stage.
But I couldn't find a workaround or alternative that does what I want.
Help please!
And many thanks...
Richard
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]