How to read request content without eating it ?

Ben RUBSON <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
Hello,

I need to implement an access control handler based on request content.

So here is my (very simplified) PerlAccessHandler code :
sub handler {
  $r = shift;
  $r->read($content,$r->headers_in->{'Content-length'});
  if($content =~ /signature=expected_signature/)
  {
    return Apache2::Const::OK;
  }
  return Apache2::Const::AUTH_REQUIRED;
}

It works.
My problem is further, when handler returns OK and Apache runs the user requested CGI script.
The request content provides some additional parameters the target CGI script needs.
However, as soon as $r->read is used, request content is no more available to the CGI script.

So my question is, how to read request content without making it unavailable to the final requested CGI ?

Thank you very much,

Best regards,

Ben
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.