mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge pull request #9553 from appwrite/feat-fix-308-redirect
Feat fix 308 redirect
This commit is contained in:
commit
aedfe0352d
4 changed files with 46 additions and 2 deletions
4
composer.lock
generated
4
composer.lock
generated
|
|
@ -8507,7 +8507,7 @@
|
||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": [],
|
"stability-flags": {},
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
|
|
@ -8531,5 +8531,5 @@
|
||||||
"platform-overrides": {
|
"platform-overrides": {
|
||||||
"php": "8.3"
|
"php": "8.3"
|
||||||
},
|
},
|
||||||
"plugin-api-version": "2.3.0"
|
"plugin-api-version": "2.6.0"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2430,4 +2430,38 @@ class SitesCustomServerTest extends Scope
|
||||||
|
|
||||||
$this->cleanupSite($siteId);
|
$this->cleanupSite($siteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testPermanentRedirect(): void
|
||||||
|
{
|
||||||
|
$siteId = $this->setupSite([
|
||||||
|
'siteId' => ID::unique(),
|
||||||
|
'name' => 'Sub project site',
|
||||||
|
'framework' => 'other',
|
||||||
|
'buildRuntime' => 'node-22',
|
||||||
|
'outputDirectory' => './'
|
||||||
|
]);
|
||||||
|
$this->assertNotEmpty($siteId);
|
||||||
|
|
||||||
|
$domain = $this->setupSiteDomain($siteId);
|
||||||
|
$this->assertNotEmpty($domain);
|
||||||
|
|
||||||
|
$deploymentId = $this->setupDeployment($siteId, [
|
||||||
|
'code' => $this->packageSite('sub-directories'),
|
||||||
|
'activate' => 'true'
|
||||||
|
]);
|
||||||
|
$this->assertNotEmpty($deploymentId);
|
||||||
|
|
||||||
|
$proxyClient = new Client();
|
||||||
|
$proxyClient->setEndpoint('http://' . $domain);
|
||||||
|
$response = $proxyClient->call(Client::METHOD_GET, '/');
|
||||||
|
$this->assertEquals(200, $response['headers']['status-code']);
|
||||||
|
$this->assertStringContainsString('Sub-directory index', $response['body']);
|
||||||
|
$response1 = $proxyClient->call(Client::METHOD_GET, '/project1');
|
||||||
|
$this->assertEquals(200, $response1['headers']['status-code']);
|
||||||
|
$this->assertStringContainsString('Sub-directory project1', $response1['body']);
|
||||||
|
$response2 = $proxyClient->call(Client::METHOD_GET, '/project1/');
|
||||||
|
$this->assertEquals(200, $response2['headers']['status-code']);
|
||||||
|
$this->assertStringContainsString('Sub-directory project1', $response2['body']);
|
||||||
|
$this->cleanupSite($siteId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
5
tests/resources/sites/sub-directories/index.html
Normal file
5
tests/resources/sites/sub-directories/index.html
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
<html lang="en">
|
||||||
|
<body>
|
||||||
|
<p>Sub-directory index</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<html lang="en">
|
||||||
|
<body>
|
||||||
|
<p>Sub-directory project1</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in a new issue