Welcome! Log In Create A New Profile

Advanced

Re: [Nginx] perl module get an empty body

Maxim Dounin
August 10, 2012 07:14AM
Hello!

On Fri, Aug 10, 2012 at 06:03:14AM -0400, darkweaver871 wrote:

> Hi all,
>
> I'm using Nginx as a reverse proxy and I use Nginx perl module to
> inspect my requests and redirect to a different upstream.
> It works well but some of request_body are empty and others just make
> nginx timeout.

[...]

>
> perl_modules /opt/test/perl/;
> perl_require switcher_test.pm;
> perl_set $test switcher_test::handler;

[...]

> sub handler {
> my $r = shift;
> if($r->has_request_body(sub{})) { return 3 };

This doesn't work as $r->has_request_body() currently assumes it's
called from a perl content handler, not from a perl variable
handler, and does bad things if called from a variable handler.

You may try to test $http_content_length instead.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

[Nginx] perl module get an empty body

darkweaver871 August 10, 2012 06:03AM

Re: [Nginx] perl module get an empty body

darkweaver871 August 10, 2012 06:04AM

Re: [Nginx] perl module get an empty body

darkweaver871 August 10, 2012 07:03AM

Re: [Nginx] perl module get an empty body

darkweaver871 August 10, 2012 09:44AM

Re: [Nginx] perl module get an empty body

Maxim Dounin August 10, 2012 07:14AM

Re: [Nginx] perl module get an empty body

darkweaver871 August 10, 2012 09:46AM

Re: [Nginx] perl module get an empty body

darkweaver871 August 10, 2012 10:12AM

Re: [Nginx] perl module get an empty body

Maxim Dounin August 10, 2012 09:56AM

Re: [Nginx] perl module get an empty body

Maxim Dounin August 10, 2012 01:12PM

Re: [Nginx] perl module get an empty body

darkweaver871 August 12, 2012 06:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 58
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready