httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject Re: [users@httpd] How to print request headers before and after processing
Date Thu, 22 Mar 2018 16:50:11 GMT
have you looked at mod_log_debug?

>     SetEnvIfExpr "%{REQUEST_URI} == '/cb2/facelets/logon.xhtml' && %{REQUEST_METHOD}
== 'GET'" login_get login_jsid=%{HTTP_COOKIE}e

is the last token  of the above line wrong? Shouldn't it just be "Coookie"?

On Thu, Mar 22, 2018 at 12:23 PM, Martin Knoblauch <knobi@knobisoft.de> wrote:
> 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



-- 
Eric Covener
covener@gmail.com

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


Mime
View raw message