Commit 257d3291 authored by Maxime Besson's avatar Maxime Besson

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

parent 8cd579f1
Pipeline #4639 passed with stage
in 9 minutes and 55 seconds
...@@ -1924,7 +1924,16 @@ sub imgnok { ...@@ -1924,7 +1924,16 @@ sub imgnok {
sub sendImage { sub sendImage {
my ( $self, $req,, $img ) = @_; 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 # Normalize url to be tolerant to SAML Path
......
...@@ -10,7 +10,7 @@ BEGIN { ...@@ -10,7 +10,7 @@ BEGIN {
require 't/test-lib.pm'; require 't/test-lib.pm';
} }
my $maintests = 15; my $maintests = 14;
my $debug = 'error'; my $debug = 'error';
my ( $issuer, $sp, $res ); my ( $issuer, $sp, $res );
my %handlerOR = ( issuer => [], sp => [] ); my %handlerOR = ( issuer => [], sp => [] );
...@@ -132,8 +132,7 @@ m#img src="http://auth.idp.com(/saml/relaySingleLogoutSOAP)\?(relay=.*?)"#s, ...@@ -132,8 +132,7 @@ m#img src="http://auth.idp.com(/saml/relaySingleLogoutSOAP)\?(relay=.*?)"#s,
), ),
'Get image' 'Get image'
); );
ok( getHeader( $res, 'Content-Type' ) eq 'image/png', 'Get an image' ) expectRedirection( $res, "http://auth.idp.com/static/common/icons/ok.png");
or explain( [ $res->[0], $res->[1] ], 'Content-Type => image/png' );
# Test if logout is done # Test if logout is done
switch ('issuer'); switch ('issuer');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment