all repos — elgit @ cd22584c7477f796f69c32a6259e174e2d0ae145

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

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.

commit

cd22584c7477f796f69c32a6259e174e2d0ae145

parent

a87f88a57c68627a1f63f1551fcef2c1f1ec7036

1 file changed, 2 insertions(+), 3 deletions(-)

changed files
M routes/git.goroutes/git.go
@@ -6,7 +6,6 @@ "log"
"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 @@ "github.com/go-git/go-git/v5/plumbing/transport/server"
) 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) 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)