Fix bad array hook in PSGI::Router

This commit is contained in:
Xavier Guimard 2020-01-28 15:27:39 +01:00
parent 14495b0445
commit 766042c3bd

View File

@ -10,9 +10,10 @@ extends 'Lemonldap::NG::Common::PSGI';
# Properties # Properties
has 'routes' => ( has 'routes' => (
is => 'rw', is => 'rw',
isa => 'HashRef', isa => 'HashRef',
default => sub { { GET => {}, POST => {}, PUT => {}, PATCH => {}, DELETE => {} } } default =>
sub { { GET => {}, POST => {}, PUT => {}, PATCH => {}, DELETE => {} } }
); );
has 'defaultRoute' => ( is => 'rw', default => 'index.html' ); has 'defaultRoute' => ( is => 'rw', default => 'index.html' );
@ -75,7 +76,7 @@ sub genRoute {
elsif ( $t eq 'ARRAY' ) { elsif ( $t eq 'ARRAY' ) {
$routes->{$word} ||= {}; $routes->{$word} ||= {};
foreach my $w ( @{$dest} ) { foreach my $w ( @{$dest} ) {
$self->genRoute( $routes->{$word}, $w, $transform ); $self->genRoute( $routes->{$word}, $w, $w, $transform );
} }
return; return;
} }