mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
Fix redirect issue when using custom domains
This commit is contained in:
@@ -6,6 +6,9 @@ class Configuration
|
||||
{
|
||||
/** @var string */
|
||||
protected $host;
|
||||
|
||||
/** @var string */
|
||||
protected $serverHost;
|
||||
|
||||
/** @var int */
|
||||
protected $port;
|
||||
@@ -15,7 +18,7 @@ class Configuration
|
||||
|
||||
public function __construct(string $host, int $port, ?string $auth = null)
|
||||
{
|
||||
$this->host = $host;
|
||||
$this->serverHost = $this->host = $host;
|
||||
|
||||
$this->port = $port;
|
||||
|
||||
@@ -27,6 +30,16 @@ class Configuration
|
||||
return $this->host;
|
||||
}
|
||||
|
||||
public function serverHost(): string
|
||||
{
|
||||
return $this->serverHost;
|
||||
}
|
||||
|
||||
public function setServerHost($serverHost)
|
||||
{
|
||||
$this->serverHost = $serverHost;
|
||||
}
|
||||
|
||||
public function auth(): ?string
|
||||
{
|
||||
return $this->auth;
|
||||
@@ -40,7 +53,7 @@ class Configuration
|
||||
public function getUrl(string $subdomain): string
|
||||
{
|
||||
$httpProtocol = $this->port() === 443 ? 'https' : 'http';
|
||||
$host = $this->host();
|
||||
$host = $this->serverHost();
|
||||
|
||||
if ($httpProtocol !== 'https') {
|
||||
$host .= ":{$this->port()}";
|
||||
|
||||
Reference in New Issue
Block a user