Invalid URL for application logo in myapplications web service
The logo URL returned by /myapplications is malformed: http:/auth.example.com//static/common/apps/demo.png
. There is a missing /
after http:
.
The bug was introduced in commit 6fde3a06
The associated unit test is wrong, as it test the malformed value:
ok(
$res->{myapplications}->[0]->{Applications}->[0]->{'Application Test 1'}
->{AppLogo} eq 'http:/auth.example.com//static/common/apps/demo.png',
' Logo app1 found'
);
Commenting the last regexp on basePath is enough to fix the problem:
diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/RESTServer.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/RESTServer.pm
index f5b760e1c..cb8b88155 100644
--- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/RESTServer.pm
+++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/RESTServer.pm
@@ -788,7 +788,7 @@ sub myApplications {
my $basePath = $self->conf->{portal};
$basePath =~ s#/*$#/#;
$basePath .= $self->p->{staticPrefix} . '/common/apps/';
- $basePath =~ s#//+#/#;
+ #$basePath =~ s#//+#/#;
my @appslist = map {
my @apps = map {
{
A better solution might be found.