From c236a70c0945ecc22d381cfb6e2c4988af32c651 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 27 Dec 2018 10:30:36 -0100 Subject: [PATCH] removing trail slash in the id of the Person Signed-off-by: Maxence Lange --- lib/webfinger.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/webfinger.php b/lib/webfinger.php index 0734d7c6..70a6f0fc 100644 --- a/lib/webfinger.php +++ b/lib/webfinger.php @@ -61,15 +61,20 @@ try { exit; } +$href = + $urlGenerator->linkToRouteAbsolute('social.ActivityPub.actorAlias', ['username' => $username]); + +if (substr($href, -1) === '/') { + $href = substr($href, 0, -1); +} + $finger = [ 'subject' => $subject, 'links' => [ [ 'rel' => 'self', 'type' => 'application/activity+json', - 'href' => $urlGenerator->linkToRouteAbsolute( - 'social.ActivityPub.actorAlias', ['username' => $username] - ) + 'href' => $href ] ] ];