Skip to content

Commit c44c60e

Browse files
committed
Fix logger not removing access when an endpoint has multiple methods
1 parent f172838 commit c44c60e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

root/app/www/public/ajax/starr.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,13 @@
250250

251251
if (count($app['endpoints'][$_POST['endpoint']]) == 1) { //-- ONLY ONE METHOD, REMOVE THE ENDPOINT
252252
unset($app['endpoints'][$_POST['endpoint']]);
253-
} else {
254-
unset($app['endpoints'][$_POST['endpoint']][$_POST['method']]); //-- MULTIPLE METHODS, REMOVE JUST THE ONE
253+
} else { //-- MULTIPLE METHODS, REMOVE JUST THE ONE
254+
foreach ($app['endpoints'][$_POST['endpoint']] as $methodIndex => $method) {
255+
if ($method == $_POST['method']) {
256+
unset($app['endpoints'][$_POST['endpoint']][$methodIndex]);
257+
break;
258+
}
259+
}
255260
}
256261

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

0 commit comments

Comments
 (0)