mirror of
https://codeberg.org/gothub/gothub
synced 2024-12-06 19:16:24 +01:00
add support for disabling git clone proxying
This commit is contained in:
+7
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user