removed some TODO tags

This commit is contained in:
2024-04-12 11:53:56 +02:00
parent b274cd4ad2
commit 12c6c665fc
5 changed files with 4 additions and 10 deletions

View File

@@ -75,12 +75,14 @@ if ($installation) {
if ($route === null) {
$response = $router->returnStatusCode(404);
} else if (!$settings->isTrustedDomain($currentHostName)) {
$error = "Untrusted Origin. Adjust the 'trusted_domains' setting " .
"to include the current host '$currentHostName' or contact the administrator to resolve this issue";
if ($route instanceof \Core\Objects\Router\ApiRoute) {
header("Content-Type: application/json");
http_response_code(403);
$response = json_encode(createError("Untrusted Origin"));
$response = json_encode(createError($error));
} else {
$response = $router->returnStatusCode(403, ["message" => "Untrusted Origin"]);
$response = $router->returnStatusCode(403, ["message" => $error]);
}
} else {
$response = $route->call($router, $pathParams);