go-chi / httprate

net/http rate limiter middleware
MIT License
270 stars 18 forks source link

Allow omitting or customizing response headers #31

Closed VojtechVitek closed 3 months ago

VojtechVitek commented 3 months ago
httprate.Limit(
    1000,
    time.Minute,
    httprate.WithResponseHeaders(httprate.ResponseHeaders{
        Limit:      "X-RateLimit-Limit",
        Remaining:  "X-RateLimit-Remaining",
        Reset:      "X-RateLimit-Reset",
        RetryAfter: "Retry-After",
        Increment:  "", // omit
    }),
)