You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Graham Leggett <mi...@sharp.fm> on 2001/06/01 13:05:48 UTC

Re: cvs commit: httpd-2.0/modules/metadata mod_headers.c

stoddard@apache.org wrote:

>   Add the 'echo' option to mod_headers Header directive. Use the new option
>   like this:
> 
>   Header echo regex
> 
>   If a header received on a request matches regex, it is copied to the response
>   headers.

Would it not make more sense to add "echo" to RequestHeader instead of
Header, because it's the request header being echoed...?

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."

Re: cvs commit: httpd-2.0/modules/metadata mod_headers.c

Posted by Bill Stoddard <bi...@wstoddard.com>.
> stoddard@apache.org wrote:
>
> >   Add the 'echo' option to mod_headers Header directive. Use the new option
> >   like this:
> >
> >   Header echo regex
> >
> >   If a header received on a request matches regex, it is copied to the response
> >   headers.
>
> Would it not make more sense to add "echo" to RequestHeader instead of
> Header, because it's the request header being echoed...?
>

I considered this. It seems technically cleaner (and less error prone) to do all the
response header work, including echoing, in the same place during request processing.
Splitting the response header work across multiple phases is a good way to introduce
non-intuitive behaviour in the header processing (think module order dependencies).  That
was my thinking anyway.

Just to let you know where I am going...
I plan to refine the patch I posted to the list a week or so ago that allows
mod_log_config style format strings to be passed on Header add|append directives. E.g.

Header add YaddaYadda "%t %D"

I was also considering adding some conditional processing to the Header add (and append,
et. al). Something perhaps like this:

Header add  YaddaYadda  "%t %D"  env=var

env would be controlled by a SetEnvIf statement to detect, say, the presense of a
particular request header.  If a particular request header is present, then header
YaddaYadda would be added to the response.

This will be -really- useful for clients instrumented to do end-to-end performance
monitoring.  The client can send a special header (signaling its presense) which will
cause Apache to collect various bits of information (configurable on the Header add format
string) and send that info back to the client in the response headers.

Bill