diff --git a/app/controllers/general.php b/app/controllers/general.php index 8d31e9507a..52ce7bc49a 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -132,7 +132,8 @@ function router(Http $utopia, Database $dbForPlatform, callable $getProjectDB, S } } - if (!in_array($host, $platformHostnames) && System::getEnv('_APP_OPTIONS_ROUTER_PROTECTION', 'enabled') === 'enabled') { + // Default must match app/config/variables.php and .env (`disabled`). Opt in with `enabled`. + if (!in_array($host, $platformHostnames) && System::getEnv('_APP_OPTIONS_ROUTER_PROTECTION', 'disabled') === 'enabled') { throw new AppwriteException(AppwriteException::GENERAL_ACCESS_FORBIDDEN, 'Router protection does not allow accessing Appwrite over this domain. Please add it as custom domain to your project or disable _APP_OPTIONS_ROUTER_PROTECTION environment variable.', view: $errorView); }