From fbea61e3a9f96453bc0d323c0f689b433a7b1a38 Mon Sep 17 00:00:00 2001 From: Terin Stock Date: Sun, 15 Sep 2024 01:23:39 +0200 Subject: fix(cmd): prioritize "smart" git http handler To support the "smart HTTP protocol" the git handler needs to be added to the mux before the cgit handler. This was previously fixed in 2022, but a bad rebase lost the change. --- main.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 4546ede..4781376 100644 --- a/main.go +++ b/main.go @@ -41,6 +41,15 @@ func main() { gitMux := mux.NewRouter() + git.New(git.Options{ + CGI: cfg.Git.CGI, + ReposRoot: cfg.ReposRoot, + ExportAll: cfg.Git.ExportAll, + Logger: logger.With("handler", "git"), + }). + WithRegister(RegistererFunc(gitMux.Handle)). + Build() + cgit.New(cgit.Options{ CGI: cfg.CGit.CGI, ReposRoot: cfg.ReposRoot, @@ -51,15 +60,6 @@ func main() { WithRegister(RegistererFunc(gitMux.Handle)). Build() - git.New(git.Options{ - CGI: cfg.Git.CGI, - ReposRoot: cfg.ReposRoot, - ExportAll: cfg.Git.ExportAll, - Logger: logger.With("handler", "git"), - }). - WithRegister(RegistererFunc(gitMux.Handle)). - Build() - m := manager.New() m.Add(&server.Server{ Name: "git", -- cgit v1.2.3