Merge pull request #10338 from appwrite/chore-upgrade-http

Chore: Upgrade HTTP
This commit is contained in:
Matej Bačo 2025-08-20 10:20:17 +02:00 committed by GitHub
commit e005276fe5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 14 deletions

View file

@ -23,10 +23,12 @@ use Utopia\Storage\Device;
use Utopia\Storage\Device\Local;
use Utopia\Storage\Storage;
use Utopia\System\System;
use Utopia\Validator\AnyOf;
use Utopia\Validator\Domain;
use Utopia\Validator\Integer;
use Utopia\Validator\Multiple;
use Utopia\Validator\Text;
use Utopia\Validator\URL;
use Utopia\Validator\WhiteList;
App::get('/v1/health')
@ -397,7 +399,7 @@ App::get('/v1/health/certificate')
],
contentType: ContentType::JSON
))
->param('domain', null, new Multiple([new Domain(), new PublicDomain()]), Multiple::TYPE_STRING, 'Domain name')
->param('domain', null, new Multiple([new AnyOf([new URL(), new Domain()]), new PublicDomain()]), Multiple::TYPE_STRING, 'Domain name')
->inject('response')
->action(function (string $domain, Response $response) {
if (filter_var($domain, FILTER_VALIDATE_URL)) {

14
composer.lock generated
View file

@ -3852,16 +3852,16 @@
},
{
"name": "utopia-php/framework",
"version": "0.33.20",
"version": "0.33.21",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/http.git",
"reference": "e1c7ab4e0b5b0a9a70256b1e00912e101e76a131"
"reference": "eb0e82e90b8fa493f99b8d131bdd25173422c493"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/http/zipball/e1c7ab4e0b5b0a9a70256b1e00912e101e76a131",
"reference": "e1c7ab4e0b5b0a9a70256b1e00912e101e76a131",
"url": "https://api.github.com/repos/utopia-php/http/zipball/eb0e82e90b8fa493f99b8d131bdd25173422c493",
"reference": "eb0e82e90b8fa493f99b8d131bdd25173422c493",
"shasum": ""
},
"require": {
@ -3893,9 +3893,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/http/issues",
"source": "https://github.com/utopia-php/http/tree/0.33.20"
"source": "https://github.com/utopia-php/http/tree/0.33.21"
},
"time": "2025-05-18T23:51:21+00:00"
"time": "2025-08-19T10:52:15+00:00"
},
{
"name": "utopia-php/image",
@ -8426,5 +8426,5 @@
"platform-overrides": {
"php": "8.3"
},
"plugin-api-version": "2.6.0"
"plugin-api-version": "2.3.0"
}

View file

@ -109,15 +109,11 @@ class ProxyCustomServerTest extends Scope
$rule = $this->createAPIRule('https://' . $domain);
$this->assertEquals(400, $rule['headers']['status-code']);
// Unexpected I would say, but it is the current behaviour
$rule = $this->createAPIRule('wss://' . $domain);
$this->assertEquals(201, $rule['headers']['status-code']);
$this->cleanupRule($rule['body']['$id']);
$this->assertEquals(400, $rule['headers']['status-code']);
// Unexpected I would say, but it is the current behaviour
$rule = $this->createAPIRule($domain . '/some-path');
$this->assertEquals(201, $rule['headers']['status-code']);
$this->cleanupRule($rule['body']['$id']);
$this->assertEquals(400, $rule['headers']['status-code']);
}
public function testCreateRedirectRule(): void