From fc3c944c160330148bc4daffad352aa1b062aaef Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Thu, 4 Apr 2024 14:07:58 +0530 Subject: [PATCH] fix: cleanup webfinger URI parsing --- routers/web/webfinger.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/routers/web/webfinger.go b/routers/web/webfinger.go index 65963cf379..099f6236a6 100644 --- a/routers/web/webfinger.go +++ b/routers/web/webfinger.go @@ -70,8 +70,7 @@ func WebfingerQuery(ctx *context.Context) { return } - p, _ := strings.CutPrefix(resource.Path, "/") - p, _ = strings.CutSuffix(p, "/") + p := strings.Trim(resource.Path, "/") if len(p) == 0 { ctx.Error(http.StatusNotFound) return