From cd22584c7477f796f69c32a6259e174e2d0ae145 Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Wed, 27 Mar 2024 00:39:33 +0200 Subject: routes: switch to net/http router BREAKING: This commit reworks routes.Handlers (and everywhere else) to use http.ServeMux -- and subsequently, Go 1.22's new net/http router. This might break something. --- routes/git.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'routes/git.go') diff --git a/routes/git.go b/routes/git.go index 1a5e035..b8877b9 100644 --- a/routes/git.go +++ b/routes/git.go @@ -6,7 +6,6 @@ import ( "net/http" "path/filepath" - "github.com/alexedwards/flow" "github.com/go-git/go-billy/v5/osfs" "github.com/go-git/go-git/v5/plumbing/format/pktline" "github.com/go-git/go-git/v5/plumbing/protocol/packp" @@ -15,7 +14,7 @@ import ( ) func (d *deps) InfoRefs(w http.ResponseWriter, r *http.Request) { - name := flow.Param(r.Context(), "name") + name := r.PathValue("name") name = filepath.Clean(name) repo := filepath.Join(d.c.Repo.ScanPath, name) @@ -61,7 +60,7 @@ func (d *deps) InfoRefs(w http.ResponseWriter, r *http.Request) { } func (d *deps) UploadPack(w http.ResponseWriter, r *http.Request) { - name := flow.Param(r.Context(), "name") + name := r.PathValue("name") name = filepath.Clean(name) repo := filepath.Join(d.c.Repo.ScanPath, name) -- cgit v1.2.3