mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
prevent functions domain and subdomain to be added as custom domain
This commit is contained in:
parent
9f7ecb98d3
commit
82e6db903a
1 changed files with 6 additions and 0 deletions
|
|
@ -47,6 +47,12 @@ App::post('/v1/proxy/rules')
|
|||
if ($domain === $mainDomain) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'You cannot assign your main domain to specific resource. Please use subdomain or a different domain.');
|
||||
}
|
||||
|
||||
$functionsDomain = App::getEnv('_APP_DOMAIN_FUNCTIONS', '');
|
||||
if (str_ends_with($functionsDomain, $domain)) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'You cannot assign your functions domain or it\'s subdomain to specific resource. Please use different domain.');
|
||||
}
|
||||
|
||||
if ($domain === 'localhost' || $domain === APP_HOSTNAME_INTERNAL) {
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please pick another one.');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue