diff --git a/app/init.php b/app/init.php index 0726998d73..ca91711e5d 100644 --- a/app/init.php +++ b/app/init.php @@ -230,6 +230,8 @@ $register = new Registry(); App::setMode(App::getEnv('_APP_ENV', App::MODE_TYPE_PRODUCTION)); if (!App::isProduction()) { + // Allow specific domains to skip public domain validation in dev environment + // Useful for existing tests involving webhooks PublicDomain::allow(['request-catcher']); } diff --git a/src/Appwrite/Platform/Workers/Webhooks.php b/src/Appwrite/Platform/Workers/Webhooks.php index c54b05b718..28bcc1688f 100644 --- a/src/Appwrite/Platform/Workers/Webhooks.php +++ b/src/Appwrite/Platform/Workers/Webhooks.php @@ -16,6 +16,7 @@ class Webhooks extends Action { private array $errors = []; private const MAX_FAILED_ATTEMPTS = 10; + private const MAX_FILE_SIZE = 5242880; // 5 MB public static function getName(): string { @@ -94,7 +95,7 @@ class Webhooks extends Action \curl_setopt($ch, CURLOPT_HEADER, 0); \curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \curl_setopt($ch, CURLOPT_TIMEOUT, 15); - \curl_setopt($ch, CURLOPT_MAXFILESIZE, 5242880); + \curl_setopt($ch, CURLOPT_MAXFILESIZE, self::MAX_FILE_SIZE); \curl_setopt($ch, CURLOPT_USERAGENT, \sprintf( APP_USERAGENT, App::getEnv('_APP_VERSION', 'UNKNOWN'),