You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Esmond Pitt <es...@bigpond.com> on 2013/04/04 07:25:49 UTC

[users@httpd] Set response header based on another response header?

Is there a way to set a response header based on the content of another
response header?

In my specific situation I am back-ended by Tomcat and I would like to add a
Pragma: no-cache header when Content-Type text/html, only, i.e. if Tomcat
has already set that content-type.

Or is this Pragma obsolete?

EJP


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


Re: [users@httpd] Set response header based on another response header?

Posted by Daniel Gruno <ru...@cord.dk>.
On 04/05/2013 01:23 PM, Esmond Pitt wrote:
> Can't be done. You can only set an environment variable based on a
> *request* header.
>  
> EJP
Not entirely true, you can do this quite easily with filters, and I use
it often for that exact purpose (except I don't use the Pragma thing, I
do other transformations). You can either write a filter module
yourself, or you can use mod_lua from trunk (we need to backport this ;(
) and use the guide in the documentation to create an output filter that
just sets a header based on another header and then returns (thus
skipping the actual filtering, but still setting the header).

This might be a bit more than a configuration directive, but
nonetheless, it _is_ possible to modify/set one response header based on
another.

With regards,
Daniel

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


RE: [users@httpd] Set response header based on another response header?

Posted by Esmond Pitt <es...@bigpond.com>.
Can't be done. You can only set an environment variable based on a *request*
header.
 
EJP

Re: [users@httpd] Set response header based on another response header?

Posted by Igor Cicimov <ic...@gmail.com>.
Set environment variable based on the first header and use it to set the
second one.
On 04/04/2013 4:26 PM, "Esmond Pitt" <es...@bigpond.com> wrote:

> Is there a way to set a response header based on the content of another
> response header?
>
> In my specific situation I am back-ended by Tomcat and I would like to add
> a
> Pragma: no-cache header when Content-Type text/html, only, i.e. if Tomcat
> has already set that content-type.
>
> Or is this Pragma obsolete?
>
> EJP
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>