diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/SAML.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/SAML.pm index 8a97bbccb..efae41e71 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/SAML.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Issuer/SAML.pm @@ -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 diff --git a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t index 0e2ca2a8b..6e3a095c5 100644 --- a/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t +++ b/lemonldap-ng-portal/t/30-Auth-and-issuer-SAML-Artifact-with-SOAP-SLO-IdP-initiated.t @@ -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');