diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index 8cc765c2ce..442bab740d 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -42,7 +42,10 @@ App::post('/v1/proxy/rules') ->inject('dbForProject') ->action(function (string $domain, string $resourceType, string $resourceId, Response $response, Document $project, Event $events, Database $dbForConsole, Database $dbForProject) { $mainDomain = App::getEnv('_APP_DOMAIN', ''); - if ($domain === $mainDomain || $domain === 'localhost' || $domain === APP_HOSTNAME_INTERNAL) { + 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.'); + } + if ($domain === 'localhost' || $domain === APP_HOSTNAME_INTERNAL) { throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please pick another one.'); }