From 554a24e44c37757dcfdb42e9eee729a201220b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 2 Dec 2024 17:56:52 +0100 Subject: [PATCH] Fix double compression --- app/controllers/general.php | 2 +- composer.json | 2 +- composer.lock | 27 ++++++++++++------- .../Modules/Sites/Http/Sites/CreateSite.php | 2 +- .../Modules/Sites/Http/Sites/UpdateSite.php | 2 +- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 29b5368e8f..91650fec26 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -488,7 +488,7 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo continue; } - $response->setHeader($header['name'], $header['value']); + $response->addHeader(\strtolower($header['name']), $header['value']); } $response diff --git a/composer.json b/composer.json index 2447e2e7d6..f04239dc1c 100644 --- a/composer.json +++ b/composer.json @@ -54,7 +54,7 @@ "utopia-php/database": "0.53.16", "utopia-php/domains": "0.5.*", "utopia-php/dsn": "0.2.1", - "utopia-php/framework": "0.33.*", + "utopia-php/framework": "dev-fix-prevent-duplicate-compression as 0.33.99", "utopia-php/fetch": "0.2.*", "utopia-php/image": "0.7.*", "utopia-php/locale": "0.4.*", diff --git a/composer.lock b/composer.lock index 7b9cd2106f..123f6bfbe3 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": "c56db8736d679aff6e2b275ec59f1dbf", + "content-hash": "026d47ead39933ab29b2ea7046bfec4f", "packages": [ { "name": "adhocore/jwt", @@ -3678,16 +3678,16 @@ }, { "name": "utopia-php/framework", - "version": "0.33.14", + "version": "dev-fix-prevent-duplicate-compression", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "45a5a2db3602fa054096f378482c7da9936f5850" + "reference": "0d535f3820a0a73b5ba03c5af27b83c0694d8368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/45a5a2db3602fa054096f378482c7da9936f5850", - "reference": "45a5a2db3602fa054096f378482c7da9936f5850", + "url": "https://api.github.com/repos/utopia-php/http/zipball/0d535f3820a0a73b5ba03c5af27b83c0694d8368", + "reference": "0d535f3820a0a73b5ba03c5af27b83c0694d8368", "shasum": "" }, "require": { @@ -3719,9 +3719,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.33.14" + "source": "https://github.com/utopia-php/http/tree/fix-prevent-duplicate-compression" }, - "time": "2024-11-20T12:39:10+00:00" + "time": "2024-12-02T16:47:45+00:00" }, { "name": "utopia-php/image", @@ -8556,9 +8556,18 @@ "time": "2024-03-07T20:33:40+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/framework", + "version": "dev-fix-prevent-duplicate-compression", + "alias": "0.33.99", + "alias_normalized": "0.33.99.0" + } + ], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": { + "utopia-php/framework": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/CreateSite.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/CreateSite.php index 2d5c197f57..1d67a1d5c4 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/CreateSite.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/CreateSite.php @@ -97,7 +97,7 @@ class CreateSite extends Base public function action(string $siteId, string $name, string $framework, bool $enabled, int $timeout, string $installCommand, string $buildCommand, string $outputDirectory, string $subdomain, string $buildRuntime, string $adapter, string $installationId, ?string $fallbackFile, string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $templateRepository, string $templateOwner, string $templateRootDirectory, string $templateVersion, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Document $user, Event $queueForEvents, Build $queueForBuilds, Database $dbForConsole, GitHub $github) { - if(!empty($adapter)) { + if (!empty($adapter)) { $configFramework = Config::getParam('frameworks')[$framework] ?? []; $adapters = \array_keys($configFramework['adapters'] ?? []); $validator = new WhiteList($adapters, true); diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/UpdateSite.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/UpdateSite.php index 7dfd05bd98..af8b2f2c12 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/UpdateSite.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/UpdateSite.php @@ -89,7 +89,7 @@ class UpdateSite extends Base public function action(string $siteId, string $name, string $framework, bool $enabled, int $timeout, string $installCommand, string $buildCommand, string $outputDirectory, string $buildRuntime, string $adapter, ?string $fallbackFile, string $installationId, ?string $providerRepositoryId, string $providerBranch, bool $providerSilentMode, string $providerRootDirectory, string $specification, Request $request, Response $response, Database $dbForProject, Document $project, Event $queueForEvents, Build $queueForBuilds, Database $dbForConsole, GitHub $github) { - if(!empty($adapter)) { + if (!empty($adapter)) { $configFramework = Config::getParam('frameworks')[$framework] ?? []; $adapters = \array_keys($configFramework['adapters'] ?? []); $validator = new WhiteList($adapters, true);