Re: X-CGI- Response Header Filtering

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

 



On Fri, 2008-11-28 at 10:22 +0100, waf EID wrote:
> Hi,
>  
> I have an httpd server running CGI which use cookies to identify
> users.
> The problem is that I would like to log the username in httpd logs.
> The only solution I ve found is adding an HTTP Response Header called
> X-CGI-USERNAME but I had to write a module that removes it (because I
> don't want my users to receive this header) just after copying it in
> the httpd environment (so I can use it in LogFormat). 
>  
> I've read in the rfc3875 (CGI) line 1502:
>    There may be additional implementation-defined CGI header fields,
>    whose field names SHOULD begin with "X-CGI-".  The server MAY
> ignore
>    (and delete) any unrecognized header fields with names beginning
> "X-
>    CGI-" that are received from the script.
>  
> The question is: are you planning to make httpd filter headers
> starting with X-CGI-, or do you have another solution so I don't have
> to use my own module?
> It would be great if you could add a directive that allows us to keep
> or remove those headers.
> 
>  
> Thanks in advance.

If a directive was added to strip these headers (it already exists, as
Nick said), then it wouldn't actually help you. Logging happens almost
last in the request-response cycle, so if you still wanted to be able to
read that header in the log phase, you can't delete it. 

I think the simplest solution would be to receive the response header,
set an environment variable from that, then unset the header. You could
then use the environment variable to log from.

You would have to write a small apache module to do that. Check out
http://www.apachetutor.org (and buy Nick's book as well :)

Cheers

Tom


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[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