class RateLimitResponseBuilder
extends ResponseBuilder
import { RateLimitResponseBuilder } from "https://deno.land/x/drash@v3.0.0-beta.2/src/modules/middleware/RateLimiter/RateLimitResponse.ts";
A Response
decorator that attaches the following behaviors:
- Response building
- X-RateLimit-* header setting
Constructors
new
RateLimitResponseBuilder(response: Response)Decorate a Response
with X-RateLimit-* header capabilities.
Properties
protected
decoratee: ResponseThe response to decorate.
Methods
addRateLimitHeaders(values: { limit: number; remaining: number; reset: number; retry_after: Date; })
Add the x-ratelimit-*
headers to the response.