summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorAravinth Manivannan <realaravinth@batsense.net>2024-04-04 10:37:58 +0200
committerEarl Warren <earl-warren@noreply.codeberg.org>2024-04-04 18:52:25 +0200
commitfc3c944c160330148bc4daffad352aa1b062aaef (patch)
treee1604429f33f261848196fc4e862996864a3ee58 /routers
parentfeat: parse for all ForgeFed actors (diff)
downloadforgejo-fc3c944c160330148bc4daffad352aa1b062aaef.tar.xz
forgejo-fc3c944c160330148bc4daffad352aa1b062aaef.zip
fix: cleanup webfinger URI parsing
Diffstat (limited to 'routers')
-rw-r--r--routers/web/webfinger.go3
1 files changed, 1 insertions, 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