You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If i use memory storage limiter middleware deduct remaining limit on each request
If I switch from memory storage to pebble middleware remaining is always Maximum - 1
How to Reproduce
package main
import"github.com/gofiber/fiber/v3"import"log"funcmain() {
app:=fiber.New()
// Steps to reproduce// Create a pebble storage instancestorage:=pebble.New(pebble.ConfigDefault)
// Limit 120 Request per user(IP) per Minutesapp.Use(limiter.New(limiter.Config{
// Maximium number of requestsMax: 60,
Expiration: 1*time.Minute,
KeyGenerator: func(c*fiber.Ctx) string { returnc.Get("X-Forwared-For") },
Storage: storage,
}))
app.Get("/test", func(c*fiber.Ctx) error {returnc.SendString("Test")})
log.Fatal(app.Listen(":3000"))
}
Expected Behavior
Remaining limit should be deducted on each request
Fiber Version
2.52.4
Code Snippet (optional)
package main
import"github.com/gofiber/fiber/v3"import"log"funcmain() {
app:=fiber.New()
// Steps to reproduce// Create a pebble storage instancestorage:=pebble.New(pebble.ConfigDefault)
// Limit 120 Request per user(IP) per Minutesapp.Use(limiter.New(limiter.Config{
// Maximium number of requestsMax: 60,
Expiration: 1*time.Minute,
KeyGenerator: func(c*fiber.Ctx) string { returnc.Get("X-Forwared-For") },
Storage: storage,
}))
app.Get("/test", func(c*fiber.Ctx) error {returnc.SendString("Test")})
log.Fatal(app.Listen(":3000"))
}
Bug Description
If i use memory storage limiter middleware deduct remaining limit on each request
If I switch from memory storage to pebble middleware remaining is always Maximum - 1
How to Reproduce
Expected Behavior
Remaining limit should be deducted on each request
Fiber Version
2.52.4
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: