···93 }
94}
95000000000000096func (d *Handle) RejectPush(w http.ResponseWriter, r *http.Request, unqualifiedRepoName string) {
97 // A text/plain response will cause git to print each line of the body
98 // prefixed with "remote: ".
···93 }
94}
9596+func (d *Handle) ReceivePack(w http.ResponseWriter, r *http.Request) {
97+ did := chi.URLParam(r, "did")
98+ name := chi.URLParam(r, "name")
99+ _, err := securejoin.SecureJoin(d.c.Repo.ScanPath, filepath.Join(did, name))
100+ if err != nil {
101+ gitError(w, err.Error(), http.StatusForbidden)
102+ d.l.Error("git: failed to secure join repo path", "handler", "ReceivePack", "error", err)
103+ return
104+ }
105+106+ d.RejectPush(w, r, name)
107+}
108+109func (d *Handle) RejectPush(w http.ResponseWriter, r *http.Request, unqualifiedRepoName string) {
110 // A text/plain response will cause git to print each line of the body
111 // prefixed with "remote: ".