Fix POST replay with different target URL (#550)

This commit is contained in:
Clément Oudot 2013-01-08 14:42:48 +00:00
parent 7cb912a595
commit 081adce03b
2 changed files with 9 additions and 9 deletions

View File

@ -829,7 +829,8 @@ sub hideCookie {
$tmp =~ s/$cookieName(http)?=[^,;]*[,;\s]*//og;
if ($tmp) {
$class->lmSetHeaderIn( $apacheRequest, 'Cookie' => $tmp );
} else {
}
else {
$class->lmUnsetHeaderIn( $apacheRequest, 'Cookie' );
}
}
@ -1500,8 +1501,7 @@ sub postUrlInit {
$d->{postUrl} ||= $url;
# Register POST form for POST URL
$transform->{ $d->{postUrl} } =
sub { $class->buildPostForm( $d->{postUrl} ) }
$transform->{$url} = sub { $class->buildPostForm( $d->{postUrl} ) }
if ( $url ne $d->{postUrl} );
# Get datas to POST
@ -1527,8 +1527,8 @@ sub postUrlInit {
}
$class->lmLog( "Compiling POST request for $url", 'debug' );
$transform->{$url} = sub {
return $class->buildPostForm($url)
$transform->{ $d->{postUrl} } = sub {
return $class->buildPostForm( $d->{postUrl} )
if ( $apacheRequest->method ne 'POST' );
$apacheRequest->add_input_filter(
sub {

View File

@ -13,7 +13,7 @@ use Lemonldap::NG::Handler::Simple qw(:locationRules :headers :post :apache)
use MIME::Base64;
use constant SAFEWRAP => ( Safe->can("wrap_code_ref") ? 1 : 0 );
our $VERSION = '1.1.2';
our $VERSION = '1.2.3';
## @imethod protected void defaultValuesInit(hashRef args)
# Set default values for non-customized variables
@ -254,7 +254,7 @@ sub postUrlInit {
$d->{postUrl} ||= $url;
# Register POST form for POST URL
$transform->{$vhost}->{ $d->{postUrl} } =
$transform->{$vhost}->{$url} =
sub { $class->buildPostForm( $d->{postUrl} ) }
if ( $url ne $d->{postUrl} );
@ -283,8 +283,8 @@ sub postUrlInit {
$class->lmLog( "Compiling POST request for $url (vhost $vhost)",
'debug' );
$transform->{$vhost}->{$url} = sub {
return $class->buildPostForm($url)
$transform->{$vhost}->{ $d->{postUrl} } = sub {
return $class->buildPostForm( $d->{postUrl} )
if ( $apacheRequest->method ne 'POST' );
$apacheRequest->add_input_filter(
sub {