Merge remote-tracking branch 'origin/develop'
Signed-off-by: snipe <snipe@snipe.net> # Conflicts: # config/version.php
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
return array (
|
||||
'app_version' => 'v8.1.4',
|
||||
'full_app_version' => 'v8.1.4 - build 18245-g101b8afb5',
|
||||
'build_version' => '18245',
|
||||
'app_version' => 'v8.1.5',
|
||||
'full_app_version' => 'v8.1.5 - build 18388-g64aeaeeee',
|
||||
'build_version' => '18388',
|
||||
'prerelease_version' => '',
|
||||
'hash_version' => 'g101b8afb5',
|
||||
'full_hash' => 'v8.1.4-180-g101b8afb5',
|
||||
'hash_version' => 'g64aeaeeee',
|
||||
'full_hash' => 'v8.1.5-141-g64aeaeeee',
|
||||
'branch' => 'master',
|
||||
);
|
||||
@@ -1324,7 +1324,11 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'api-throttle:api']], fu
|
||||
return response()->json(
|
||||
[
|
||||
'version' => config('version.app_version'),
|
||||
], 200);
|
||||
'build_version' => config('version.build_version'),
|
||||
'hash_version' => config('version.hash_version'),
|
||||
'full_version' => config('version.full_app_version')
|
||||
]
|
||||
);
|
||||
}); // end version api routes
|
||||
|
||||
|
||||
|
||||
@@ -39,4 +39,25 @@ class ApiRateLimitTest extends TestCase
|
||||
->assertHeader('Retry-After', 60);
|
||||
}
|
||||
|
||||
public function testRateLimitDecreasesRemainingOverSixty()
|
||||
{
|
||||
config(['app.api_throttle_per_minute' => 80]);
|
||||
$expected_remaining = (config('app.api_throttle_per_minute') - 1);
|
||||
$admin = User::factory()->create();
|
||||
|
||||
for ($x = 0; $x < 5; $x++) {
|
||||
|
||||
$this->actingAsForApi($admin)
|
||||
->getJson(route('api.users.me'))
|
||||
->assertOk()
|
||||
->assertHeader('X-Ratelimit-Remaining', $expected_remaining--);
|
||||
|
||||
}
|
||||
|
||||
$this->actingAsForApi($admin)
|
||||
->getJson(route('api.users.me'))
|
||||
->assertStatus(200)
|
||||
->assertHeader('Retry-After', 60);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user