From ed285f101acf183b2b76be8dafdbff22b2a078db Mon Sep 17 00:00:00 2001 From: Awilum Date: Tue, 14 Jan 2020 17:29:47 +0300 Subject: [PATCH] feat(core): update routes validation for API's #349 --- flextype/routes/api/delivery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flextype/routes/api/delivery.php b/flextype/routes/api/delivery.php index da9bab25..730c2fef 100644 --- a/flextype/routes/api/delivery.php +++ b/flextype/routes/api/delivery.php @@ -43,7 +43,7 @@ $app->get('/api/entries', function (Request $request, Response $response) use ($ // Set delivery token file if ($delivery_token_file_data = $flextype['parser']->decode(Filesystem::read($delivery_token_file_path), 'yaml')) { if ($delivery_token_file_data['state'] == 'disabled' || - $delivery_token_file_data['limit_calls'] <= $delivery_token_file_data['calls']) { + ($delivery_token_file_data['limit_calls'] != 0 && $delivery_token_file_data['calls'] >= $delivery_token_file_data['limit_calls'])) { return $response->withJson(["detail" => "Incorrect authentication credentials."], 401); } else { // Fetch entry