Commit 9fcd4f24 by Qiang Xue

Fixed allowance for ratelimiter. [skip ci]

parent 765fc4d0
...@@ -110,7 +110,7 @@ class RateLimiter extends ActionFilter ...@@ -110,7 +110,7 @@ class RateLimiter extends ActionFilter
throw new TooManyRequestsHttpException($this->errorMessage); throw new TooManyRequestsHttpException($this->errorMessage);
} else { } else {
$user->saveAllowance($request, $action, $allowance - 1, $current); $user->saveAllowance($request, $action, $allowance - 1, $current);
$this->addRateLimitHeaders($response, $limit, $allowance, (int) (($limit - $allowance) * $window / $limit)); $this->addRateLimitHeaders($response, $limit, $allowance - 1, (int) (($limit - $allowance) * $window / $limit));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment