diff --git a/serve/serve.go b/serve/serve.go index af7eea7..d2091ef 100644 --- a/serve/serve.go +++ b/serve/serve.go @@ -140,6 +140,15 @@ func Serve(port string) { }) app.Get("/:user/:repo", pages.HandleRepo) app.Get("/:user/:repo/commit/:commit", pages.HandleCommit) + app.Get("/diff/:user/:repo/commit/:commit", func(c *fiber.Ctx) error { + if proxying == "true" { + utils.ProxyRequest(c, "https://github.com/"+c.Params("user")+"/"+c.Params("repo")+"/commit/"+c.Params("commit")+".diff") + return nil + } else { + c.Redirect("https://github.com/" + c.Params("user") + "/" + c.Params("repo") + "/commit/" + c.Params("commit") + ".diff") + return nil + } + }) app.Get("/:user/:repo/info/+", func(c *fiber.Ctx) error { // This is needed but it looks like git doesn't send it. Or maybe i just shouldn't program at midnight param := "?service=git-upload-pack" diff --git a/views/commit.html b/views/commit.html index 9b88fbe..f58f614 100644 --- a/views/commit.html +++ b/views/commit.html @@ -19,7 +19,7 @@

{{.CommitHashShortened}} | {{.CommitName}}

Raw