1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 16:10:08 +01:00

Specifically look for cert files in secured() method.

Fixes #1210
This commit is contained in:
Matt Stauffer
2022-03-17 13:08:17 -04:00
parent 461eabbf01
commit c8e70396e4
2 changed files with 4 additions and 2 deletions

View File

@@ -477,7 +477,9 @@ public function replaceOldLoopbackWithNew($siteConf, $old, $new)
public function secured()
{
return collect($this->files->scandir($this->certificatesPath()))
->map(function ($file) {
->filter(function ($file) {
return ends_with($file, ['.key', '.csr', '.crt', '.conf']);
})->map(function ($file) {
return str_replace(['.key', '.csr', '.crt', '.conf'], '', $file);
})->unique()->values()->all();
}

View File

@@ -787,7 +787,7 @@ public function test_it_returns_secured_sites()
$files = Mockery::mock(Filesystem::class);
$files->shouldReceive('scandir')
->once()
->andReturn(['helloworld.tld.crt']);
->andReturn(['helloworld.tld.crt', '.DS_Store']);
swap(Filesystem::class, $files);