mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Added configurable API throttling, Handled API errors standardly
This commit is contained in:
@ -44,4 +44,15 @@ class ApiConfigTest extends TestCase
|
||||
$resp->assertJsonCount(2, 'data');
|
||||
}
|
||||
|
||||
public function test_requests_per_min_alters_rate_limit()
|
||||
{
|
||||
$resp = $this->actingAsApiEditor()->get($this->endpoint);
|
||||
$resp->assertHeader('x-ratelimit-limit', 180);
|
||||
|
||||
config()->set(['api.requests_per_minute' => 10]);
|
||||
|
||||
$resp = $this->actingAsApiEditor()->get($this->endpoint);
|
||||
$resp->assertHeader('x-ratelimit-limit', 10);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user