How to print request headers before and after processing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

 so I need some little help. I need to modify request headers in some situations and for debugging, I want to print the content of the header before and after processing. So I looked at mod_log_config and found:

----
%{VARNAME}i : The contents of VARNAME: header line(s) in the request sent to the server. Changes made by other modules (e.g. mod_headers) affect this. If you're interested in what the request header was prior to when most modules would have modified it, use mod_setenvif to copy the header into an internal environment variable and log that value with the %{VARNAME}e described above.
----

 And actually %{varname}i prints out the processed request header. Where I have problems is the "use mod_setenvif to copy the header into an internal environment variable" part. The request header in question is "Cookie". So I tried to do the following:

a) in httpd.conf

    LogFormat "%t [%{ms}T ms] %h %u \"%m %U '%{login_jsid}e' '%{Cookie}i'\" s:%>s l:%b S:%{SSL_PROTOCOL}x C:%{SSL_CIPHER}x" xxxlogheader

b) in the virtual host

    SetEnvIfExpr "%{REQUEST_URI} == '/cb2/facelets/logon.xhtml' && %{REQUEST_METHOD} == 'GET'" login_get login_jsid=%{HTTP_COOKIE}e
    CustomLog "..../apache2/logs/login_log" xxxlogheader env=login_get

So I would actually expect the content of the Cookie  being printed twice when doing no additional processing. Instead I get:

   "GET /xxx/facelets/logon.xhtml '%{HTTP_COOKIE}e' 'JSESSIONID=yyyyy; /xxx_textLocale=en/US'"

 Which indicates that my assignment in the SetEnvIfExpr directive is wrong. Any help how to get that right?

TIA
Martin
--
------------------------------------------------------
Martin Knoblauch
email: k n o b i AT knobisoft DOT de
www: http://www.knobisoft.de

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux