Skip to content

Commit c8e7039

Browse files
committed
Specifically look for cert files in secured() method.
Fixes #1210
1 parent 461eabb commit c8e7039

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cli/Valet/Site.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,9 @@ public function replaceOldLoopbackWithNew($siteConf, $old, $new)
477477
public function secured()
478478
{
479479
return collect($this->files->scandir($this->certificatesPath()))
480-
->map(function ($file) {
480+
->filter(function ($file) {
481+
return ends_with($file, ['.key', '.csr', '.crt', '.conf']);
482+
})->map(function ($file) {
481483
return str_replace(['.key', '.csr', '.crt', '.conf'], '', $file);
482484
})->unique()->values()->all();
483485
}

tests/SiteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ public function test_it_returns_secured_sites()
787787
$files = Mockery::mock(Filesystem::class);
788788
$files->shouldReceive('scandir')
789789
->once()
790-
->andReturn(['helloworld.tld.crt']);
790+
->andReturn(['helloworld.tld.crt', '.DS_Store']);
791791

792792
swap(Filesystem::class, $files);
793793

0 commit comments

Comments
 (0)