mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-21 19:32:58 +00:00
fix cache docs error (#1769)
This commit is contained in:
parent
b9efc76722
commit
1fd6eabba9
4
middleware/cache/README.md
vendored
4
middleware/cache/README.md
vendored
@ -59,7 +59,7 @@ app.Use(New(Config{
|
||||
return time.Second * time.Duration(newCacheTime)
|
||||
},
|
||||
KeyGenerator: func(c *fiber.Ctx) string {
|
||||
return c.Path()
|
||||
return utils.CopyString(c.Path())
|
||||
}
|
||||
}))
|
||||
|
||||
@ -99,7 +99,7 @@ type Config struct {
|
||||
// Key allows you to generate custom keys, by default c.Path() is used
|
||||
//
|
||||
// Default: func(c *fiber.Ctx) string {
|
||||
// return c.Path()
|
||||
// return utils.CopyString(c.Path())
|
||||
// }
|
||||
KeyGenerator func(*fiber.Ctx) string
|
||||
|
||||
|
2
middleware/cache/cache_test.go
vendored
2
middleware/cache/cache_test.go
vendored
@ -267,7 +267,7 @@ func Test_CustomKey(t *testing.T) {
|
||||
var called bool
|
||||
app.Use(New(Config{KeyGenerator: func(c *fiber.Ctx) string {
|
||||
called = true
|
||||
return c.Path()
|
||||
return utils.CopyString(c.Path())
|
||||
}}))
|
||||
|
||||
app.Get("/", func(c *fiber.Ctx) error {
|
||||
|
Loading…
x
Reference in New Issue
Block a user