diff options
author | Anirudh Oppiliappan <x@icyphox.sh> | 2024-03-27 00:39:33 +0200 |
---|---|---|
committer | Anirudh Oppiliappan <x@icyphox.sh> | 2024-03-27 00:44:14 +0200 |
commit | cd22584c7477f796f69c32a6259e174e2d0ae145 (patch) | |
tree | 2a9092b182842147fbdb17b0de4e588780645e9a /routes/git.go | |
parent | routes: add raw file view (diff) | |
download | legitrx-cd22584c7477f796f69c32a6259e174e2d0ae145.tar.gz legitrx-cd22584c7477f796f69c32a6259e174e2d0ae145.tar.zst legitrx-cd22584c7477f796f69c32a6259e174e2d0ae145.zip |
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.
Diffstat (limited to 'routes/git.go')
-rw-r--r-- | routes/git.go | 5 |
1 files changed, 2 insertions, 3 deletions
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) |