Skip to content

Commit

Permalink
Dont return a 200 for server pings when a migration is in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
austinwbest committed Sep 18, 2024
1 parent a001392 commit db6b294
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions root/app/www/public/functions/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ function apiRequestLocal($endpoint, $parameters = [], $payload = [])
case 'server-log':
return viewLog($parameters['name']);
case 'server-ping':
if (getFile(MIGRATION_FILE)) {
apiResponse(423, ['error' => 'Migration in progress']);
}

return defined('DOCKWATCH_COMMITS') && defined('DOCKWATCH_BRANCH') ? 'v' . APP_X . '.' . APP_Y . '.' . DOCKWATCH_COMMITS . ' - ' . DOCKWATCH_BRANCH : 'v0.0.0';
default:
apiResponse(405, ['error' => 'Invalid GET request (endpoint=' . $endpoint . ')']);
Expand Down

0 comments on commit db6b294

Please sign in to comment.