1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-22 08:42:32 -05:00

fix: cleanup webfinger URI parsing

This commit is contained in:
Aravinth Manivannan 2024-04-04 14:07:58 +05:30 committed by Earl Warren
parent f7ca56557c
commit fc3c944c16

View file

@ -70,8 +70,7 @@ func WebfingerQuery(ctx *context.Context) {
return return
} }
p, _ := strings.CutPrefix(resource.Path, "/") p := strings.Trim(resource.Path, "/")
p, _ = strings.CutSuffix(p, "/")
if len(p) == 0 { if len(p) == 0 {
ctx.Error(http.StatusNotFound) ctx.Error(http.StatusNotFound)
return return