Skip to content

Commit

Permalink
Fix logger not removing access when an endpoint has multiple methods
Browse files Browse the repository at this point in the history
  • Loading branch information
austinwbest committed Nov 17, 2024
1 parent f172838 commit c44c60e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions root/app/www/public/ajax/starr.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,13 @@

if (count($app['endpoints'][$_POST['endpoint']]) == 1) { //-- ONLY ONE METHOD, REMOVE THE ENDPOINT
unset($app['endpoints'][$_POST['endpoint']]);
} else {
unset($app['endpoints'][$_POST['endpoint']][$_POST['method']]); //-- MULTIPLE METHODS, REMOVE JUST THE ONE
} else { //-- MULTIPLE METHODS, REMOVE JUST THE ONE
foreach ($app['endpoints'][$_POST['endpoint']] as $methodIndex => $method) {
if ($method == $_POST['method']) {
unset($app['endpoints'][$_POST['endpoint']][$methodIndex]);
break;
}
}
}

$app['endpoints'] = json_encode($app['endpoints'], JSON_UNESCAPED_SLASHES);
Expand Down

0 comments on commit c44c60e

Please sign in to comment.