httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: Reading the post request
Date Mon, 09 Jul 2007 07:20:34 GMT
On Mon, 9 Jul 2007 10:04:58 +0530
"Dumindu Pallewela" <pallewela@gmail.com> wrote:

> Hi all,
> 
> In an authentication module I'm developing, I need to read the post
> request body and see if a particular token is there. if that is
> present, I need to process the whole request.
> 
> However, I have read the whole request body even if I don't need all
> that data, just to verify that the post doesn't contain the specific
> token that I'm looking for.

You mean, read POST data and decide based on that whether to handle it?

That's broken design.  Not necessarily your module, but the application
it's part of, is broken.  You should be able to make that decision
based on the request headers.

Having said that, there are several ways to do what you want.
Probably the most generic would be an input filter that'll dup the data,
so your handler can go first and read them without consuming them.
mod_security offers an example you could look at.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

Mime
View raw message