httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <>
Subject Re: Reading POST request without destroying it?
Date Fri, 13 Oct 2006 20:39:43 GMT
On Friday 13 October 2006 20:42, Steve Kemp wrote:
> On Fri, Oct 13, 2006 at 08:38:44PM +0100, Nick Kew wrote:
> > >   Is there a simple way for my module to read/process the incoming
> > >  POST data, whilst still allowing the data to be passed on to
> > >  mod_cgi, etc?
> >
> > That's what input filters are for.  How best to do it depends on the
> > nature and size of the requests you're processing.
>   Thanks.
>   I'm currently trying to find some decent sample code...  The requests
>  I expect to be parsing are "small" in the sense that they will
>  typically have less than ten key=value elements.

In that case, you can just collect all the input in a single buffer and
parse it (don't forget to check the size and reject anything ridiculously
big, so you don't invite a DOS attack).  Do that in an input filter and
return the data to the caller if you want it to work with CGI. 
You have to take some care over the ordering of the processing:
ISTR my old apachetutor article on request processing explains it.

Nick Kew

Application Development with Apache - the Apache Modules Book

View raw message