Skip to content

Commit 771b59c

Browse files
committed
fix custom
1 parent a5837b2 commit 771b59c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/custom.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ var CustomReplacer = map[string]string{
1212
}
1313

1414
func RegisterCustom(app *fiber.App) {
15-
for _, v := range CustomReplacer {
16-
app.All(fmt.Sprintf("/%s/*", v), func(c *fiber.Ctx) error {
17-
source := strings.TrimPrefix(c.Path(), fmt.Sprintf("/%s", v))
15+
for k, v := range CustomReplacer {
16+
app.All(fmt.Sprintf("/%s/*", k), func(c *fiber.Ctx) error {
17+
source := strings.TrimPrefix(c.Path(), fmt.Sprintf("/%s", k))
1818
uri := fmt.Sprintf("%s%s", v, source)
19+
fmt.Println(uri)
1920
resp, err := utils.Get(uri, nil)
2021
if err != nil {
2122
return Catch(c, err)

0 commit comments

Comments
 (0)