mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
adding custom domain validation against _APP_CUSTOM_DOMAIN_DENY_LIST
This commit is contained in:
@@ -61,8 +61,11 @@ App::post('/v1/proxy/rules')
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'You cannot assign your main domain to specific resource. Please use subdomain or a different domain.');
|
||||
}
|
||||
|
||||
$deniedDomains = System::getEnv('_APP_CUSTOM_DOMAIN_DENY_LIST', '');
|
||||
$denyListString = System::getEnv('_APP_CUSTOM_DOMAIN_DENY_LIST', '');
|
||||
$deniedDomains = array_map('trim', explode(',', $denyListString));
|
||||
var_dump($deniedDomains);
|
||||
foreach ($deniedDomains as $deniedDomain) {
|
||||
var_dump(str_ends_with($domain, $deniedDomain));
|
||||
if (str_ends_with($domain, $deniedDomain)) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'You cannot assign your functions domain or its subdomain to a specific resource. Please use a different domain.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user