-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix finding hosts * remove placeholder code * surrogate key flushing * attempt to flush any all caches
- Loading branch information
Showing
6 changed files
with
141 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
FROM caddy:2.5.1-builder-alpine | ||
|
||
RUN xcaddy build --with github.com/darkweak/souin/plugins/caddy \ | ||
--with github.com/darkweak/[email protected].16 | ||
--with github.com/darkweak/[email protected].17 | ||
|
||
|
||
# See https://caddyserver.com/docs/conventions#file-locations for details | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Tests\Unit; | ||
|
||
use mattvb91\CaddyPhp\Config\Apps\Http; | ||
use PHPUnit\Framework\TestCase; | ||
use function mattvb91\CaddyPhp\findHost; | ||
|
||
class MiscTest extends TestCase | ||
{ | ||
/** | ||
* @covers \mattvb91\CaddyPhp\findHost | ||
*/ | ||
public function test_finding_host() | ||
{ | ||
$http = new Http(); | ||
$server = new Http\Server(); | ||
$server->setListen([":80"]); | ||
|
||
|
||
$host = (new Http\Server\Routes\Match\Host('shops')) | ||
->setHosts([ | ||
"{http.request.host}.localhost", | ||
]); | ||
|
||
$shopDeploymentsRoute = new Http\Server\Route(); | ||
$shopDeploymentsRoute->addMatch($host) | ||
->setTerminal(true); | ||
|
||
|
||
$server->addRoute($shopDeploymentsRoute); | ||
$http->addServer('platform', $server); | ||
|
||
$this->assertEquals($host, findHost($http, 'shops')['host']); | ||
} | ||
|
||
} |