Skip to content

Commit d467926

Browse files
authored
Fix broken Travis (dingo#1531)
* rate limit: Limit should apply to all routes Exceeding the rate limit should return 403 for all further requests; the route of the request should not matter. The current behavior is such that exceeding the rate limit will only 403 that particular route. * Updated dev master alias and blueprint version * Fixed dingo blueprint version * Added missing abstract method * Added missing abstract method * Stoped double handling exceptions * Apply fixes from StyleCI * Updated to add missing abstract method
1 parent ac29865 commit d467926

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Http/RateLimit/Handler.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ public function rateLimitRequest(Request $request, $limit = 0, $expires = 0)
9999
// throttle with the given values.
100100
} elseif ($limit > 0 || $expires > 0) {
101101
$this->throttle = new Route(['limit' => $limit, 'expires' => $expires]);
102-
103102
$this->keyPrefix = sha1($request->path());
104103

105104
// Otherwise we'll use the throttle that gives the consumer the largest
@@ -172,7 +171,7 @@ protected function getMatchingThrottles()
172171
*/
173172
protected function key($key)
174173
{
175-
return sprintf('dingo.api.%s.%s.%s', $this->keyPrefix, $key, $this->getRateLimiter());
174+
return sprintf('dingo.api.%s.%s', $key, $this->getRateLimiter());
176175
}
177176

178177
/**

tests/Stubs/ApplicationStub.php

+5
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ public function register($provider, $options = [], $force = false)
3737
//
3838
}
3939

40+
public function runningUnitTests()
41+
{
42+
// TODO: Implement runningUnitTests() method.
43+
}
44+
4045
public function registerDeferredProvider($provider, $service = null)
4146
{
4247
//

0 commit comments

Comments
 (0)