all repos — elgit @ cfea2a3ba078b13b46a99963953175f6d1c16ff1

fork of legit: web frontend for git, written in go

address linter complaints

Alan Pearce
commit

cfea2a3ba078b13b46a99963953175f6d1c16ff1

parent

6c5cc57b578117ef8d56432f3e8b114cb39b5aee

1 file changed, 5 insertions(+), 4 deletions(-)

changed files
M routes/handler.goroutes/handler.go
@@ -44,13 +44,14 @@
return } - if rest == "info/refs" && + switch { + case rest == "info/refs" && r.URL.RawQuery == "service=git-upload-pack" && - r.Method == "GET" { + r.Method == "GET": d.InfoRefs(w, r, params) - } else if rest == "git-upload-pack" && r.Method == "POST" { + case rest == "git-upload-pack" && r.Method == "POST": d.UploadPack(w, r, params) - } else if r.Method == "GET" { + case r.Method == "GET": if fixed, found := strings.CutSuffix(r.URL.Path, "/"); found { http.Redirect(w, r, fixed, http.StatusPermanentRedirect) } else {