Skip to main content

write_route_rate_limit_middleware

Function write_route_rate_limit_middleware 

Source
pub async fn write_route_rate_limit_middleware(
    __arg0: State<RateLimitState>,
    req: Request,
    next: Next,
) -> Response
Expand description

Combined middleware for write routes that applies appropriate rate limit based on the request path and method.

Must be applied AFTER signature middleware (needs SignerContext).

Rate limit mapping:

  • POST /order, PUT /order -> OrderPlacement
  • DELETE /order, DELETE /order_cloid -> OrderCancellation
  • All other write routes -> ApiRequest