Example #1
0
 /**
  * Attach the after filter to adjust the response.
  *
  * @return void
  */
 protected function attachAfterFilter()
 {
     $this->router->after(function (Request $request, Response $response) {
         $response->headers->set('X-RateLimit-Limit', $this->limiter->getThrottle()->getLimit());
         $response->headers->set('X-RateLimit-Remaining', $this->limiter->getRemainingLimit());
         $response->headers->set('X-RateLimit-Reset', $this->limiter->getRateLimitReset());
     });
 }