面倒くさい…
このコミットが含まれているのは:
コミット
5bd624af13
|
@ -12,7 +12,6 @@ import (
|
|||
"gitler.moe/suwako/gitlin/utils"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/cache"
|
||||
"github.com/gofiber/fiber/v2/middleware/compress"
|
||||
"github.com/gofiber/fiber/v2/middleware/limiter"
|
||||
// For debugging purposes
|
||||
|
@ -62,9 +61,6 @@ func Serve(port string) {
|
|||
},
|
||||
})
|
||||
|
||||
app.Use(cache.New(cache.Config{
|
||||
Expiration: 5 * time.Minute,
|
||||
}))
|
||||
// For debugging purposes
|
||||
// app.Use(logger.New(logger.Config{
|
||||
// Format: "[${ip}]:${port} ${status} - ${method} ${path} ${queryParams}\n",
|
||||
|
@ -186,10 +182,10 @@ func Serve(port string) {
|
|||
app.Get("/gist/:user/:gistID", pages.HandleGist)
|
||||
app.Get("/download/gist/:user/:gistID/:revision", func(c *fiber.Ctx) error {
|
||||
if proxying == "true" {
|
||||
utils.ProxyRequest(c, "https://gist.github.com/"+c.Params("user")+"/"+c.Params("gistID")+"/archive/"+c.Params("revision")+".zip")
|
||||
utils.ProxyRequest(c, "https://gist.github.com/"+c.Params("user")+"/"+c.Params("gistID")+"/archive/"+c.Params("revision")+".tar.gz")
|
||||
return nil
|
||||
} else {
|
||||
c.Redirect("https://gist.github.com/" + c.Params("user") + "/" + c.Params("gistID") + "/archive/" + c.Params("revision") + ".zip")
|
||||
c.Redirect("https://gist.github.com/" + c.Params("user") + "/" + c.Params("gistID") + "/archive/" + c.Params("revision") + ".tar.gz")
|
||||
return nil
|
||||
}
|
||||
})
|
||||
|
|
読み込み中…
新しいイシューから参照