missing POST data but not GET.....
missing POST data but not GET.....
am 14.05.2008 04:13:32 von Tracy12
Hi,
we have mod_perl auth handler
if the form(html) sumission is GET the sumitted data is avaible insid the
mod_perl auth handler and also after that.
But strange this is if the form submission is Post the data is available
with the mod_perl handler but not after that, After the
execution of the auth hanlder the post data is lost,
Is this kind of a bug or any configuration issue?
Waiting for a early reply
Thanks
--
View this message in context: http://www.nabble.com/missing-POST-data-but-not-GET.....-tp1 7222133p17222133.html
Sent from the mod_perl - General mailing list archive at Nabble.com.
Re: missing POST data but not GET.....
am 14.05.2008 08:20:06 von Rob French
Hi,
POST data is read directly from the socket and can only be read once.
You must save the POST'd data in a data structure that is passed or
available to the different handlers in order to access it multiple
times.
Here is a good explanation of the process, they use a different method
than the one I describe but it also works:
http://modperlbook.org/html/A-2-Reusing-Data-from-POST-Reque sts.html
Rgrds,
Rob
On Tue, May 13, 2008 at 7:13 PM, Tracy12 wrote:
>
> Hi,
>
> we have mod_perl auth handler
>
> if the form(html) sumission is GET the sumitted data is avaible insid the
> mod_perl auth handler and also after that.
>
> But strange this is if the form submission is Post the data is available
> with the mod_perl handler but not after that, After the
> execution of the auth hanlder the post data is lost,
>
> Is this kind of a bug or any configuration issue?
>
> Waiting for a early reply
>
> Thanks
>
> --
> View this message in context: http://www.nabble.com/missing-POST-data-but-not-GET.....-tp1 7222133p17222133.html
> Sent from the mod_perl - General mailing list archive at Nabble.com.
>
>
Re: missing POST data but not GET.....
am 15.05.2008 00:53:55 von Joe Schaefer
--- Rob French wrote:
> Hi,
>
> POST data is read directly from the socket and can
> only be read once.
No. POST data is read through httpd's filter api.
How many times you can read it depends on what's in
the input filter chain.
The original poster should be using apreq
(APR::Request::Apache2 or Apache2::Request)
for this, not some other perl module that doesn't
exploit the filter api.
Re: missing POST data but not GET.....
am 15.05.2008 03:38:01 von Tracy12
Hi,
Thanks for the reply,
Can you pls clariy what is meant by the following,
>>
>>The original poster should be using apreq
>>(APR::Request::Apache2 or Apache2::Request)
>>for this, not some other perl module that doesn't
>>exploit the filter api.
Does this mean the final target application which consumes POST data should
use Apache2::Request or the Auth handler should should do "SOMETHING " to
preserve data using Apache2::Request. At the moment I am not doing any
specific request handling.
at the moment I have sample CGI script writen in perl which get the request
parameter. as follows,
Are you saying that I should use Apache2::Request in the following instead
of use CGI qw(:standard) , pls clarify
#!/usr/bin/perl
use warnings;
use strict;
use CGI qw(:standard);
my $username = param('code') || "unknown";
printf "Content-type: text/html\r\n\r\n";
printf "
Hello, World. $username";
for more information I will state the top part of my Auth Handler. As you
can see I am using Apache2::compat as I got old api calls as well.
package AuthCAS;
use strict;
use vars qw( $VERSION);
$VERSION = '1.1';
my @ISA = qw(Exporter);
my @EXPORT = qw($errors);
my $errors;
use Carp;
use Apache2::compat;
use CGI;
use CGI::Session;
use CGI::Cookie;
use Apache::Constants ':common';
use Apache::Constants qw(HTTP_MOVED_TEMPORARILY);
use Apache::Constants qw(M_GET OK DECLINED);
.....
.....
--
View this message in context: http://www.nabble.com/missing-POST-data-but-not-GET.....-tp1 7222133p17244429.html
Sent from the mod_perl - General mailing list archive at Nabble.com.
Re: missing POST data but not GET.....
am 15.05.2008 03:44:46 von Joe Schaefer
--- Tracy12 wrote:
>
> Hi,
>
> Thanks for the reply,
>
> Can you pls clariy what is meant by the following,
>
> >>
> >>The original poster should be using apreq
> >>(APR::Request::Apache2 or Apache2::Request)
> >>for this, not some other perl module that doesn't
> >>exploit the filter api.
>
> Does this mean the final target application which
> consumes POST data should
> use Apache2::Request
You could, but it's not necessary.
> or the Auth handler should
> should do "SOMETHING " to
> preserve data using Apache2::Request.
Use Apache2::Request in the auth handler, and apreq
will do the SOMETHING you need automatically.
> At the moment
> I am not doing any
> specific request handling.
>
> at the moment I have sample CGI script writen in
> perl which get the request
> parameter. as follows,
> Are you saying that I should use Apache2::Request in
> the following instead
> of use CGI qw(:standard) , pls clarify
>
> #!/usr/bin/perl
> use warnings;
> use strict;
> use CGI qw(:standard);
>
> my $username = param('code') || "unknown";
> printf "Content-type: text/html\r\n\r\n";
> printf "Hello, World. $username";
>
> for more information I will state the top part of my
> Auth Handler. As you
> can see I am using Apache2::compat as I got old api
> calls as well.
>
> package AuthCAS;
>
> use strict;
> use vars qw( $VERSION);
> $VERSION = '1.1';
> my @ISA = qw(Exporter);
> my @EXPORT = qw($errors);
> my $errors;
>
> use Carp;
> use Apache2::compat;
> use CGI;
> use CGI::Session;
> use CGI::Cookie;
If you can drop the CGI:: modules and use
Apache2::Request and Apache2::Cookie instead,
it'll just work. By default, using apreq in
an auth handler will preserve the POST data
within the input filter chain for your
content handler to use as it sees fit. You
don't necessarily need to use apreq in your
content handler for things to work right.
For all apreq cares, your content handler
could be a cgi script written in python.
Re: missing POST data but not GET.....
am 15.05.2008 06:17:40 von Tracy12
Thanks for the reply,
instead of rewriting the CGI used locations isn't there a way to get the
functionality.
I am making use of $r primary for some session handling only. I am not doing
any read or manipulation with the POSTed data.
Do you think that CGI removal is a must?
Without much rework can't get the Apache2::Request to work. At this stage I
prefer less code change as every other fuctionality is working.
Would just a initialization of following work,
my $req = Apache2::Request->new($r);
Thanks
Joe Schaefer-6 wrote:
>
> --- Tracy12 wrote:
>
>>
>> Hi,
>>
>> Thanks for the reply,
>>
>> Can you pls clariy what is meant by the following,
>>
>> >>
>> >>The original poster should be using apreq
>> >>(APR::Request::Apache2 or Apache2::Request)
>> >>for this, not some other perl module that doesn't
>> >>exploit the filter api.
>>
>> Does this mean the final target application which
>> consumes POST data should
>> use Apache2::Request
>
> You could, but it's not necessary.
>
>> or the Auth handler should
>> should do "SOMETHING " to
>> preserve data using Apache2::Request.
>
> Use Apache2::Request in the auth handler, and apreq
> will do the SOMETHING you need automatically.
>
>
>> At the moment
>> I am not doing any
>> specific request handling.
>>
>> at the moment I have sample CGI script writen in
>> perl which get the request
>> parameter. as follows,
>> Are you saying that I should use Apache2::Request in
>> the following instead
>> of use CGI qw(:standard) , pls clarify
>>
>> #!/usr/bin/perl
>> use warnings;
>> use strict;
>> use CGI qw(:standard);
>>
>> my $username = param('code') || "unknown";
>> printf "Content-type: text/html\r\n\r\n";
>> printf "Hello, World. $username";
>>
>> for more information I will state the top part of my
>> Auth Handler. As you
>> can see I am using Apache2::compat as I got old api
>> calls as well.
>>
>> package AuthCAS;
>>
>> use strict;
>> use vars qw( $VERSION);
>> $VERSION = '1.1';
>> my @ISA = qw(Exporter);
>> my @EXPORT = qw($errors);
>> my $errors;
>>
>> use Carp;
>> use Apache2::compat;
>> use CGI;
>> use CGI::Session;
>> use CGI::Cookie;
>
> If you can drop the CGI:: modules and use
> Apache2::Request and Apache2::Cookie instead,
> it'll just work. By default, using apreq in
> an auth handler will preserve the POST data
> within the input filter chain for your
> content handler to use as it sees fit. You
> don't necessarily need to use apreq in your
> content handler for things to work right.
> For all apreq cares, your content handler
> could be a cgi script written in python.
>
>
>
>
>
>
>
>
--
View this message in context: http://www.nabble.com/missing-POST-data-but-not-GET.....-tp1 7222133p17245705.html
Sent from the mod_perl - General mailing list archive at Nabble.com.
Re: missing POST data but not GET.....
am 16.05.2008 08:14:31 von Tracy12
Yes this works with no issues, keeping the existing code untouched
Thanks
robf-3 wrote:
>
> Hi,
>
> POST data is read directly from the socket and can only be read once.
> You must save the POST'd data in a data structure that is passed or
> available to the different handlers in order to access it multiple
> times.
>
> Here is a good explanation of the process, they use a different method
> than the one I describe but it also works:
>
> http://modperlbook.org/html/A-2-Reusing-Data-from-POST-Reque sts.html
>
> Rgrds,
> Rob
>
> On Tue, May 13, 2008 at 7:13 PM, Tracy12 wrote:
>>
>> Hi,
>>
>> we have mod_perl auth handler
>>
>> if the form(html) sumission is GET the sumitted data is avaible insid
>> the
>> mod_perl auth handler and also after that.
>>
>> But strange this is if the form submission is Post the data is available
>> with the mod_perl handler but not after that, After the
>> execution of the auth hanlder the post data is lost,
>>
>> Is this kind of a bug or any configuration issue?
>>
>> Waiting for a early reply
>>
>> Thanks
>>
>> --
>> View this message in context:
>> http://www.nabble.com/missing-POST-data-but-not-GET.....-tp1 7222133p17222133.html
>> Sent from the mod_perl - General mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/missing-POST-data-but-not-GET.....-tp1 7222133p17268278.html
Sent from the mod_perl - General mailing list archive at Nabble.com.
Re: missing POST data but not GET.....
am 23.05.2008 09:26:31 von Tracy12
I removed the mp1 codes,
Also used Apache2 cookie, but still the post data is not there but still I
am using CGI session.
Should I use some other session handling...
How can I make sure that my $r is a Apache2 request.
Do I have to do as follows and use $req for all the references e.g setting
remote user variables etc
my $req = Apache2::Request->new($r, POST_MAX => "1M");
waiting for a quick reply. pls advice
I have the following use statements and not refering to any mp1 code
use CGI;
use CGI::Session;
use Apache2::ServerUtil;
use Apache2::Request;
use Apache2::URI;
use Apache2::Cookie;
use Apache2::Log;
use APR::URI ;
Joe Schaefer-6 wrote:
>
>
> --- Rob French wrote:
>
>> Hi,
>>
>> POST data is read directly from the socket and can
>> only be read once.
>
> No. POST data is read through httpd's filter api.
> How many times you can read it depends on what's in
> the input filter chain.
>
> The original poster should be using apreq
> (APR::Request::Apache2 or Apache2::Request)
> for this, not some other perl module that doesn't
> exploit the filter api.
>
>
>
>
>
>
--
View this message in context: http://www.nabble.com/missing-POST-data-but-not-GET.....-tp1 7222133p17419769.html
Sent from the mod_perl - General mailing list archive at Nabble.com.