From 431e26c1533047d650a189d9bd0f8287af580cd5 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Thu, 4 Jan 2024 16:37:15 +0530 Subject: [PATCH] Allow certain domains to skip validation --- app/init.php | 6 ++++++ composer.json | 2 +- composer.lock | 14 +++++++------- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/init.php b/app/init.php index 19c181f455..87ac7f8e0c 100644 --- a/app/init.php +++ b/app/init.php @@ -78,6 +78,7 @@ use Utopia\Validator\IP; use Utopia\Validator\URL; use Utopia\Validator\WhiteList; use Utopia\CLI\Console; +use Utopia\Domains\Validator\PublicDomain; const APP_NAME = 'Appwrite'; const APP_DOMAIN = 'appwrite.io'; @@ -232,6 +233,11 @@ $register = new Registry(); App::setMode(App::getEnv('_APP_ENV', App::MODE_TYPE_PRODUCTION)); +$isProduction = App::getEnv('_APP_ENV', App::MODE_TYPE_DEVELOPMENT) === App::MODE_TYPE_PRODUCTION; +if (!$isProduction) { + PublicDomain::allow(['request-catcher']); +} + /* * ENV vars */ diff --git a/composer.json b/composer.json index 2e8bd8c538..70e822029e 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", "utopia-php/database": "0.45.*", - "utopia-php/domains": "0.4.*", + "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.1.*", "utopia-php/framework": "0.32.*", "utopia-php/image": "0.5.*", diff --git a/composer.lock b/composer.lock index ef4e55e4de..5383663e0f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "def5b4f6d260324aefe22c6980a89e9d", + "content-hash": "92b527993518d6b893e3d226064edac0", "packages": [ { "name": "adhocore/jwt", @@ -1962,16 +1962,16 @@ }, { "name": "utopia-php/domains", - "version": "0.4.1", + "version": "0.5.0", "source": { "type": "git", "url": "https://github.com/utopia-php/domains.git", - "reference": "815198420852f924a350150ca201edfc6f19cf20" + "reference": "bf07f60326f8389f378ddf6fcde86217e5cfe18c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/domains/zipball/815198420852f924a350150ca201edfc6f19cf20", - "reference": "815198420852f924a350150ca201edfc6f19cf20", + "url": "https://api.github.com/repos/utopia-php/domains/zipball/bf07f60326f8389f378ddf6fcde86217e5cfe18c", + "reference": "bf07f60326f8389f378ddf6fcde86217e5cfe18c", "shasum": "" }, "require": { @@ -2016,9 +2016,9 @@ ], "support": { "issues": "https://github.com/utopia-php/domains/issues", - "source": "https://github.com/utopia-php/domains/tree/0.4.1" + "source": "https://github.com/utopia-php/domains/tree/0.5.0" }, - "time": "2023-12-28T09:23:51+00:00" + "time": "2024-01-03T22:04:27+00:00" }, { "name": "utopia-php/dsn",