mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
feat: Config option to set default protocol to https (#110)
* feat: Config option to set default protocol to https * style: Fix for StyleCI
This commit is contained in:
@@ -59,14 +59,19 @@ class ShareCurrentWorkingDirectoryCommand extends ShareCommand
|
||||
return str_replace('.', '-', basename($projectPath));
|
||||
}
|
||||
|
||||
protected function prepareSharedHost($host): string
|
||||
protected function detectProtocol($host): string
|
||||
{
|
||||
$certificateFile = ($_SERVER['HOME'] ?? $_SERVER['USERPROFILE']).DIRECTORY_SEPARATOR.'.config'.DIRECTORY_SEPARATOR.'valet'.DIRECTORY_SEPARATOR.'Certificates'.DIRECTORY_SEPARATOR.$host.'.crt';
|
||||
|
||||
if (file_exists($certificateFile)) {
|
||||
return 'https://'.$host;
|
||||
return 'https://';
|
||||
}
|
||||
|
||||
return $host;
|
||||
return config('expose.default_https', false) ? 'https://' : 'http://';
|
||||
}
|
||||
|
||||
protected function prepareSharedHost($host): string
|
||||
{
|
||||
return $this->detectProtocol($host).$host;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user