|
@@ -86,7 +86,7 @@ discard block |
|
|
block discarded – undo |
|
86
|
86
|
$anonPeriod = $this->reflector->getAnnotationParameter('AnonRateThrottle', 'period'); |
|
87
|
87
|
$userLimit = $this->reflector->getAnnotationParameter('UserRateThrottle', 'limit'); |
|
88
|
88
|
$userPeriod = $this->reflector->getAnnotationParameter('UserRateThrottle', 'period'); |
|
89
|
|
- $rateLimitIdentifier = get_class($controller) . '::' . $methodName; |
|
|
89
|
+ $rateLimitIdentifier = get_class($controller).'::'.$methodName; |
|
90
|
90
|
if ($userLimit !== '' && $userPeriod !== '' && $this->userSession->isLoggedIn()) { |
|
91
|
91
|
$this->limiter->registerUserRequest( |
|
92
|
92
|
$rateLimitIdentifier, |
|
@@ -109,7 +109,7 @@ discard block |
|
|
block discarded – undo |
|
109
|
109
|
*/ |
|
110
|
110
|
public function afterException($controller, $methodName, \Exception $exception) { |
|
111
|
111
|
if ($exception instanceof RateLimitExceededException) { |
|
112
|
|
- if (stripos($this->request->getHeader('Accept'),'html') === false) { |
|
|
112
|
+ if (stripos($this->request->getHeader('Accept'), 'html') === false) { |
|
113
|
113
|
$response = new DataResponse([], $exception->getCode()); |
|
114
|
114
|
} else { |
|
115
|
115
|
$response = new TemplateResponse( |
Please login to merge, or discard this patch.