From f7ca56557cb8c8d606ed4640ae739f970ebbb609 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Tue, 2 Apr 2024 01:27:28 +0530 Subject: [PATCH] feat: parse for all ForgeFed actors --- routers/web/webfinger.go | 65 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/routers/web/webfinger.go b/routers/web/webfinger.go index 2eced4f05f..65963cf379 100644 --- a/routers/web/webfinger.go +++ b/routers/web/webfinger.go @@ -82,38 +82,39 @@ func WebfingerQuery(ctx *context.Context) { switch len(parts) { case 1: // user u, err = user_model.GetUserByName(ctx, parts[0]) - // case 2: // repository - // ctx.Error(http.StatusNotFound) - // return - // - // case 3: - // switch parts[2] { - // case "issues": - // ctx.Error(http.StatusNotFound) - // return - // - // case "pulls": - // ctx.Error(http.StatusNotFound) - // return - // - // case "projects": - // ctx.Error(http.StatusNotFound) - // return - // - // default: - // ctx.Error(http.StatusNotFound) - // return - // - // } - // case 4: - // if parts[3] == "teams" { - // ctx.Error(http.StatusNotFound) - // return - // - // } else { - // ctx.Error(http.StatusNotFound) - // return - // } + case 2: // repository + ctx.Error(http.StatusNotFound) + return + + case 3: + switch parts[2] { + case "issues": + ctx.Error(http.StatusNotFound) + return + + case "pulls": + ctx.Error(http.StatusNotFound) + return + + case "projects": + ctx.Error(http.StatusNotFound) + return + + default: + ctx.Error(http.StatusNotFound) + return + + } + case 4: + //nolint:gocritic + if parts[3] == "teams" { + ctx.Error(http.StatusNotFound) + return + + } else { + ctx.Error(http.StatusNotFound) + return + } default: ctx.Error(http.StatusNotFound)