From 0bfce6201768b123ecb2eadf9aec0075e82422de Mon Sep 17 00:00:00 2001 From: shimon Date: Mon, 12 May 2025 19:25:22 +0300 Subject: [PATCH] debug --- app/controllers/general.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 7852ed7066..3d39d201f0 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -80,13 +80,6 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw if ($rule->isEmpty()) { - var_dump([ - '$host' => $host, - '$appDomainFunctions' => $appDomainFunctions, - '$appDomainSites' => $appDomainSites, - ] - ); - $appDomainFunctionsFallback = System::getEnv('_APP_DOMAIN_FUNCTIONS_FALLBACK', ''); $appDomainFunctions = System::getEnv('_APP_DOMAIN_FUNCTIONS', ''); $appDomainSites = System::getEnv('_APP_DOMAIN_SITES', ''); @@ -98,6 +91,14 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw throw new AppwriteException(AppwriteException::GENERAL_ACCESS_FORBIDDEN, 'This domain cannot be used for security reasons. Please use any subdomain instead.', view: $errorView); } + var_dump([ + '$host' => $host, + '$previewHostname' => $previewHostname, + '$appDomainFunctions' => $appDomainFunctions, + '$appDomainSites' => $appDomainSites, + ] + ); + if (\str_ends_with($host, $appDomainFunctions) || \str_ends_with($host, $appDomainSites)) { $exception = new AppwriteException(AppwriteException::RULE_NOT_FOUND, 'This domain is not connected to any Appwrite resources. Visit domains tab under function/site settings to configure it.', view: $errorView);