Merge pull request #13029 from appwrite/fix/router-protection-default

fix: default router protection to disabled when unset
This commit is contained in:
Chirag Aggarwal authored and GitHub committed 2026-07-28 17:08:46 +05:30
commit ffd3c7f7a5
1 file changed
+2 -1
+2 -1
View File
@@ -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);
}