add support for disabling git clone proxying

This commit is contained in:
Arya Kiran
2023-06-03 12:54:52 +08:00
parent edbce82ad2
commit 30a0fd5b41
+7 -2
View File
@@ -142,8 +142,13 @@ func Serve(port string) {
}
})
app.Post("/:user/:repo/git-upload-pack", func(c *fiber.Ctx) error {
utils.ProxyRequest(c, "https://github.com/"+c.Params("user")+"/"+c.Params("repo")+".git/git-upload-pack")
return nil
if proxying == "true" {
utils.ProxyRequest(c, "https://github.com/"+c.Params("user")+"/"+c.Params("repo")+".git/git-upload-pack")
return nil
} else {
c.Redirect("https://github.com/" + c.Params("user") + "/" + c.Params("repo") + ".git/git-upload-pack")
return nil
}
})
app.Get("/:user/:repo/blob/:branch/+", pages.FileView)
app.Get("/:user/:repo/tree/:branch/+", pages.DirView)