From 468d6fdde37a87e0e7ef8fd8aad2f718f29a86b3 Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Sun, 12 Apr 2020 20:14:59 +0200 Subject: [PATCH] Render endpoint case insensitive (Fixes #2147) --- lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI/Router.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI/Router.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI/Router.pm index b1e0655d9..ccebb2004 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI/Router.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI/Router.pm @@ -55,6 +55,7 @@ sub genRoute { else { $dest ||= $word; } + $word = lc $word; if ( $dest =~ /^(.+)\.html$/ ) { my $tpl = $1 or die; $self->logger->debug("route $dest will use $tpl"); @@ -144,6 +145,7 @@ sub handler { sub followPath { my ( $self, $req, $routes, $path ) = @_; + $path->[0] = lc $path->[0] if $path->[0]; if ( $path->[0] and defined $routes->{ $path->[0] } ) { my $w = shift @$path; if ( ref( $routes->{$w} ) eq 'CODE' ) { -- GitLab