Fix display of ok/nok image during multi-sp saml logout

This commit is contained in:
Maxime Besson 2019-03-11 17:38:44 +01:00
parent 8cd579f19f
commit 257d329151
2 changed files with 12 additions and 4 deletions

View File

@ -1924,7 +1924,16 @@ sub imgnok {
sub sendImage {
my ( $self, $req,, $img ) = @_;
return $self->p->staticFile( $req, "common/$img", 'image/png' );
return [
302,
[
'Location' => $self->conf->{portal}
. $self->p->staticPrefix
. '/common/'
. $img,
],
[],
];
}
# Normalize url to be tolerant to SAML Path

View File

@ -10,7 +10,7 @@ BEGIN {
require 't/test-lib.pm';
}
my $maintests = 15;
my $maintests = 14;
my $debug = 'error';
my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] );
@ -132,8 +132,7 @@ m#img src="http://auth.idp.com(/saml/relaySingleLogoutSOAP)\?(relay=.*?)"#s,
),
'Get image'
);
ok( getHeader( $res, 'Content-Type' ) eq 'image/png', 'Get an image' )
or explain( [ $res->[0], $res->[1] ], 'Content-Type => image/png' );
expectRedirection( $res, "http://auth.idp.com/static/common/icons/ok.png");
# Test if logout is done
switch ('issuer');