diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Session/REST.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Session/REST.pm index 1ebb81333..41dfef49d 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Session/REST.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Session/REST.pm @@ -5,7 +5,7 @@ use Mouse; use Lemonldap::NG::Common::Conf::Constants; use JSON qw(from_json to_json); -our $VERSION = '2.0.8'; +our $VERSION = '2.0.9'; has sessionTypes => ( is => 'rw' ); @@ -219,16 +219,11 @@ sub _session { my $apacheSession = $self->getApacheSession( $mod, $id ) or return $self->sendError( $req, undef, 400 ); - my %session = %{ $apacheSession->data }; + my %session = %{ $apacheSession->data }; unless ($raw) { - my $separator = $self->separator(); foreach my $k ( keys %session ) { $session{$k} = '**********' if ( $self->hAttr =~ /\b$k\b/ ); - if ( $session{$k} =~ /$separator/ ) { - $self->logger->debug("Convert \"$k\" value to array"); - $session{$k} = [ split /$separator/, $session{$k} ]; - } } } diff --git a/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-default.t b/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-default.t index 59373b4a1..0eedbfd11 100644 --- a/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-default.t +++ b/lemonldap-ng-portal/t/31-Auth-and-issuer-CAS-default.t @@ -145,7 +145,7 @@ ok( $res = eval { JSON::from_json( $res->[2]->[0] ) }, ' GET JSON' ) or print STDERR $@; ok( $res->{cn} eq 'Frédéric Accents', 'UTF-8 values' ) or explain( $res, 'cn => Frédéric Accents' ); -ok( ref( $res->{multi} ) eq "ARRAY" and $res->{multi}->[0] =~ /value/ ) +ok( $res->{multi} =~ /value1;value2/ ) or explain( $res->{multi}, 'Multi valued attribute' ); count(4); diff --git a/lemonldap-ng-portal/t/35-REST-sessions-with-REST-server.t b/lemonldap-ng-portal/t/35-REST-sessions-with-REST-server.t index 43e61225e..ffd86f24d 100644 --- a/lemonldap-ng-portal/t/35-REST-sessions-with-REST-server.t +++ b/lemonldap-ng-portal/t/35-REST-sessions-with-REST-server.t @@ -101,8 +101,8 @@ ok( $res = eval { JSON::from_json( $res->[2]->[0] ) }, ' GET JSON' ) or print STDERR $@; ok( $res->{_session_id} eq $spId, ' Good ID' ) or explain( $res, "_session_id => $spId" ); -ok( ref $res->{array} eq 'ARRAY', ' Array ref found' ) - or explain( $res, "array => Ref" ); +ok( $res->{array} =~ /;/, 'Mulivalued attribute found' ) + or explain( $res, "Multivalued attribute" ); count(4); # Session key