feat: add error handling
This commit is contained in:
parent
b3e1b4f212
commit
8e4943d5ae
@ -3,6 +3,7 @@ package route
|
||||
import (
|
||||
"leech/config"
|
||||
"leech/html"
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
"sort"
|
||||
@ -12,7 +13,11 @@ import (
|
||||
)
|
||||
|
||||
func HandleList(c *fiber.Ctx) error {
|
||||
req := c.Params("req")
|
||||
encodedReq := c.Params("req")
|
||||
req, err := url.QueryUnescape(encodedReq)
|
||||
if err != nil {
|
||||
return c.Status(fiber.StatusInternalServerError).SendString(err.Error())
|
||||
}
|
||||
c.Set(fiber.HeaderContentType, fiber.MIMETextHTML)
|
||||
if req == "" {
|
||||
keys := make([]string, 0, len(config.Config.ServeDirs))
|
||||
|
Loading…
Reference in New Issue
Block a user