aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorLibravatar Terin Stock <terinjokes@gmail.com>2024-09-15 01:23:39 +0200
committerLibravatar Terin Stock <terinjokes@gmail.com>2024-09-15 01:23:39 +0200
commitfbea61e3a9f96453bc0d323c0f689b433a7b1a38 (patch)
tree0b7dd7bf3da15220a7a802146428edb2a497b863 /main.go
parentfix(cgit): configure assets directory (diff)
downloadcgit-httpd-trunk.tar.xz
fix(cmd): prioritize "smart" git http handlerHEADv0.5.2trunk
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.
Diffstat (limited to 'main.go')
-rw-r--r--main.go18
1 files changed, 9 insertions, 9 deletions
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",