all repos — elgit @ 6341582f87934debe76e53975204945ce64da392

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

fix: disallow clones of ignored repositories
Alan Pearce alan@alanpearce.eu
Mon, 31 Mar 2025 17:42:05 +0200
commit

6341582f87934debe76e53975204945ce64da392

parent

70c5e539567b2aa428b69d3744a26a4fb0f2e4cf

1 files changed, 6 insertions(+), 0 deletions(-)

jump to
M routes/handler.goroutes/handler.go
@@ -24,6 +24,12 @@ params["name"] = params["category"] 		params["category"] = ""
 	}
 
+	if d.isNotAllowed(path.Join(params["category"], params["name"])) {
+		d.Write404(w)
+
+		return
+	}
+
 	if r.URL.RawQuery == "service=git-receive-pack" {
 		w.WriteHeader(http.StatusBadRequest)
 		_, err := w.Write([]byte("no pushing allowed!"))