From 4be4780917e5d4781403af7e600e6c3f67cc8b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Oudot?= Date: Tue, 21 Jun 2011 12:58:47 +0000 Subject: [PATCH] Test content-length before reading socket (#338) --- .../lib/Lemonldap/NG/Handler/Proxy.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Proxy.pm b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Proxy.pm index b308873b7..a3bb7c919 100644 --- a/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Proxy.pm +++ b/modules/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Proxy.pm @@ -10,7 +10,7 @@ use strict; use Lemonldap::NG::Handler::Simple qw(:apache :headers :traces); use LWP::UserAgent; -our $VERSION = '1.0.0'; +our $VERSION = '1.1.0'; ########################################## # COMPATIBILITY WITH APACHE AND APACHE 2 # @@ -89,8 +89,10 @@ sub run($$) { if ( $r->method eq "POST" ) { my $len = $r->headers_in->{'Content-Length'}; my $buf; - $r->read( $buf, $len ); - $request->content($buf); + if ($len) { + $r->read( $buf, $len ); + $request->content($buf); + } } $headers_set = 0;