Merge branch 'feat-sites' into chore-add-site-domains-var

This commit is contained in:
Matej Bačo 2024-11-20 14:13:39 +01:00 committed by GitHub
commit 4a8c063d51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 10 deletions

View file

@ -516,6 +516,7 @@ App::init()
// Only run Router when external domain
if ($host !== $mainDomain) {
if (router($utopia, $dbForConsole, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $queueForFunctions, $geodb, $isResourceBlocked)) {
$utopia->getRoute()?->label('router', 'true');
return;
}
}
@ -734,6 +735,7 @@ App::options()
// Only run Router when external domain
if ($host !== $mainDomain) {
if (router($utopia, $dbForConsole, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $queueForFunctions, $geodb, $isResourceBlocked)) {
$utopia->getRoute()?->label('router', 'true');
return;
}
}
@ -1028,7 +1030,9 @@ App::get('/robots.txt')
$template = new View(__DIR__ . '/../views/general/robots.phtml');
$response->text($template->render(false));
} else {
router($utopia, $dbForConsole, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $queueForFunctions, $geodb, $isResourceBlocked);
if(router($utopia, $dbForConsole, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $queueForFunctions, $geodb, $isResourceBlocked)) {
$utopia->getRoute()?->label('router', 'true');
}
}
});
@ -1055,7 +1059,9 @@ App::get('/humans.txt')
$template = new View(__DIR__ . '/../views/general/humans.phtml');
$response->text($template->render(false));
} else {
router($utopia, $dbForConsole, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $queueForFunctions, $geodb, $isResourceBlocked);
if(router($utopia, $dbForConsole, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForUsage, $queueForFunctions, $geodb, $isResourceBlocked)) {
$utopia->getRoute()?->label('router', 'true');
}
}
});
@ -1147,7 +1153,13 @@ App::get('/v1/ping')
App::wildcard()
->groups(['api'])
->label('scope', 'global')
->action(function () {
->inject('utopia')
->action(function (App $utopia) {
$handeledByRouter = $utopia->getRoute()?->getLabel('router', 'false');
if(\boolval($handeledByRouter)) {
return;
}
throw new AppwriteException(AppwriteException::GENERAL_ROUTE_NOT_FOUND);
});

14
composer.lock generated
View file

@ -3677,16 +3677,16 @@
},
{
"name": "utopia-php/framework",
"version": "0.33.13",
"version": "0.33.14",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/http.git",
"reference": "4ecab88e424a136ffaa27cdf3db3c60f76c777e4"
"reference": "45a5a2db3602fa054096f378482c7da9936f5850"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/http/zipball/4ecab88e424a136ffaa27cdf3db3c60f76c777e4",
"reference": "4ecab88e424a136ffaa27cdf3db3c60f76c777e4",
"url": "https://api.github.com/repos/utopia-php/http/zipball/45a5a2db3602fa054096f378482c7da9936f5850",
"reference": "45a5a2db3602fa054096f378482c7da9936f5850",
"shasum": ""
},
"require": {
@ -3718,9 +3718,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/http/issues",
"source": "https://github.com/utopia-php/http/tree/0.33.13"
"source": "https://github.com/utopia-php/http/tree/0.33.14"
},
"time": "2024-11-15T08:37:31+00:00"
"time": "2024-11-20T12:39:10+00:00"
},
{
"name": "utopia-php/image",
@ -8557,7 +8557,7 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {