1
0
Fork 0
mirror of synced 2024-07-02 21:20:58 +12:00

Fix exception condition

This commit is contained in:
Jake Barnby 2023-08-22 14:14:20 -04:00
parent e7d5d25263
commit 45a4e076ea
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -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.');
}