You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Craig Sebenik <cr...@netapp.com> on 2003/07/11 00:55:31 UTC

HTTP_REFERER in mod_ext_filter

Currently, mod_ext_filter doesn't seem to grab all of the environment
variables. One that's notably missing is HTTP_REFERER. But, I can't figure
out where this env variable is set. I searched thru the source files (*.c
and *.h) and the only reference I found was in
modules/ssl/ssl_engine_vars.c and modules/mappers/mod_rewrite.c.

I was hoping someone could point me to how/where this env var is set. I am
pretty new to the apace src, so I apologize if this is an "obvious"  (aka
stupid :> ) question.

TIA
Craig

Re: HTTP_REFERER in mod_ext_filter

Posted by Jeff Trawick <tr...@attglobal.net>.
Andrew Ho wrote:
> There is another function, ap_add_cgi_vars(), in server/util_script.c
> which sets REQUEST_URI, SCRIPT_NAME, and all the other CGI variables we
> are accustomed to. It looks like mod_ext_filter calls ap_add_cgi_vars()
> but not ap_add_common_vars().

see attached patch :)

Re: HTTP_REFERER in mod_ext_filter

Posted by Andrew Ho <an...@tellme.com>.
Hello,

CS>Currently, mod_ext_filter doesn't seem to grab all of the environment
CS>variables. One that's notably missing is HTTP_REFERER. But, I can't
CS>figure out where this env variable is set. I searched thru the source
CS>files (*.c and *.h) and the only reference I found was in
CS>modules/ssl/ssl_engine_vars.c and modules/mappers/mod_rewrite.c.

The various HTTP_* environment variables that CGI scripts see are part of
the CGI specification; they correspond specifically to any HTTP request
headers. These are set by ap_add_common_vars() in server/util_script.c.  

You didn't find HTTP_REFERER specifically, because ap_add_common_vars()
just cycles through all request headers (except Authorization and
Proxy-Authorization, for security reasons) and sets appropriately named
environment variables.

There is another function, ap_add_cgi_vars(), in server/util_script.c
which sets REQUEST_URI, SCRIPT_NAME, and all the other CGI variables we
are accustomed to. It looks like mod_ext_filter calls ap_add_cgi_vars()
but not ap_add_common_vars().

Humbly,

Andrew

----------------------------------------------------------------------
Andrew Ho               http://www.tellme.com/       andrew@tellme.com
Engineer                    1-800-555-TELL          Voice 650-930-9062
Tellme Networks, Inc.                                 Fax 650-930-9101
----------------------------------------------------------------------