Rewrite location header

This commit is contained in:
Marcel Pociot
2020-10-25 23:40:45 +01:00
parent 538c7da446
commit 880259657f
5 changed files with 56 additions and 6 deletions

View File

@@ -36,4 +36,16 @@ class Configuration
{
return intval($this->port);
}
public function getUrl(string $subdomain): string
{
$httpProtocol = $this->port() === 443 ? 'https' : 'http';
$host = $this->host();
if ($httpProtocol !== 'https') {
$host .= ":{$this->port()}";
}
return "{$subdomain}.{$host}";
}
}