From 3934f74a5aee574ff4b72ecab2e68fd516047284 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 18 Jul 2024 13:35:27 +0200 Subject: [PATCH] mvc: hook default action in api.php in case someone bolds an api call to the controller index. --- src/opnsense/www/api.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/opnsense/www/api.php b/src/opnsense/www/api.php index 5d038de75..eb9afc5e1 100644 --- a/src/opnsense/www/api.php +++ b/src/opnsense/www/api.php @@ -33,7 +33,10 @@ try { }); $router = new OPNsense\Mvc\Router('/api/', 'Api'); - $response = $router->routeRequest($_SERVER['REQUEST_URI']); + $response = $router->routeRequest($_SERVER['REQUEST_URI'], [ + 'action' => 'indexAction', + ]); + if (!$response->isSent()) { $response->send(); }