Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-22 09:54:24 +01:00

feat: parse for all ForgeFed actors

This commit is contained in:
Aravinth Manivannan 2024-04-02 01:27:28 +05:30 committed by Earl Warren
parent 8273f8b756
commit f7ca56557c

View file

@ -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)