From 771b59c71bf03422b6ded47e04a9297372d9a3a2 Mon Sep 17 00:00:00 2001 From: Zhang Minghan Date: Wed, 4 Oct 2023 09:09:52 +0800 Subject: [PATCH] fix custom --- packages/custom.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/custom.go b/packages/custom.go index e5f5d5d..a99da46 100644 --- a/packages/custom.go +++ b/packages/custom.go @@ -12,10 +12,11 @@ var CustomReplacer = map[string]string{ } func RegisterCustom(app *fiber.App) { - for _, v := range CustomReplacer { - app.All(fmt.Sprintf("/%s/*", v), func(c *fiber.Ctx) error { - source := strings.TrimPrefix(c.Path(), fmt.Sprintf("/%s", v)) + for k, v := range CustomReplacer { + app.All(fmt.Sprintf("/%s/*", k), func(c *fiber.Ctx) error { + source := strings.TrimPrefix(c.Path(), fmt.Sprintf("/%s", k)) uri := fmt.Sprintf("%s%s", v, source) + fmt.Println(uri) resp, err := utils.Get(uri, nil) if err != nil { return Catch(c, err)