You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Kiffin Gish <ki...@tomtom.com> on 2008/01/13 10:17:14 UTC

Logging POST body ...

Hi there.

I'm using ap_hook_translate_name(hook_translate_name, NULL, NULL,
APR_HOOK_REALLY_FIRST).

Within the routine hook_translate_name I'd like to check for requests of
type POST and then log the body.

How can I do this, e.g. by peeking forward and reading the incoming
stream without actually affecting/emptying the contents of the relevant
bucket?

Thanks alot in advance,
Kiffin

-- 
Kiffin Gish | Desktop & Services Development | TomTom | kiffin.gish@tomtom.com | +31 (0) 6 15529214 mobile | +31 (0) 20 850 0989 office


This e-mail message contains information which is confidential and may be privileged. It is intended for use by the addressee only. If you are not the intended addressee, we request that you notify the sender immediately and delete or destroy this e-mail message and any attachment(s), without copying, saving, forwarding, disclosing or using its contents in any other way. TomTom N.V., TomTom International BV or any other company belonging to the TomTom group of companies will not be liable for damage relating to the communication by e-mail of data, documents or any other information.

Re: Logging POST body ...

Posted by Michael Vergoz <mv...@binarysec.com>.
hi,

have a look : 
http://mail-archives.apache.org/mod_mbox/httpd-dev/200602.mbox/%3c001f01c62884$d1a4f240$6700a8c0@ordixpsp2%3e

regards,
Michael Vergoz

Ruediger Pluem a écrit :
> On 01/13/2008 10:17 AM, Kiffin Gish wrote:
>   
>> Hi there.
>>
>> I'm using ap_hook_translate_name(hook_translate_name, NULL, NULL,
>> APR_HOOK_REALLY_FIRST).
>>
>> Within the routine hook_translate_name I'd like to check for requests of
>> type POST and then log the body.
>>
>> How can I do this, e.g. by peeking forward and reading the incoming
>> stream without actually affecting/emptying the contents of the relevant
>> bucket?
>>     
>
> No. The best way is to write an input filter and capture the stream while
> it is requested from the application. If you need the whole request body
> before any byte reaches the application it might be worth having a look
> at mod_security (http://www.modsecurity.org/) and see how they do just
> that (e.g. for virus scanning).
>
> Regards
>
> Rüdiger
>
>
>   


-- 
Michael Vergoz
BinarySEC SAS / R&D
mv@binarysec.com - http://www.binarysec.com/
try{ BinarySEC 2.3.1 } catch{ webvirus } !


Re: Logging POST body ...

Posted by Ruediger Pluem <rp...@apache.org>.

On 01/13/2008 10:17 AM, Kiffin Gish wrote:
> Hi there.
> 
> I'm using ap_hook_translate_name(hook_translate_name, NULL, NULL,
> APR_HOOK_REALLY_FIRST).
> 
> Within the routine hook_translate_name I'd like to check for requests of
> type POST and then log the body.
> 
> How can I do this, e.g. by peeking forward and reading the incoming
> stream without actually affecting/emptying the contents of the relevant
> bucket?

No. The best way is to write an input filter and capture the stream while
it is requested from the application. If you need the whole request body
before any byte reaches the application it might be worth having a look
at mod_security (http://www.modsecurity.org/) and see how they do just
that (e.g. for virus scanning).

Regards

Rüdiger