This commit is contained in:
2020-11-18 17:00:16 +08:00
parent a47d1aaf06
commit 52093df208
4 changed files with 9 additions and 12 deletions
+4 -9
View File
@@ -733,19 +733,14 @@ abstract class ClientAbstracts extends Component implements IClient
if (strpos($domain, ':' . $port) !== false) {
$domain = str_replace(':' . $port, '', $domain);
}
$this->port = $isHttps ? 443 : $this->port;
if (isIp($domain)) {
$this->host = $domain;
} else {
} else if ($this->isUseSwoole()) {
$this->host = System::gethostbyname($domain) ?? $domain;
} else {
$this->host = $domain;
}
if (!empty($this->port)) {
$port = $this->port;
}
if (!empty($port) && $port != 443) {
$this->host .= ':' . $port;
}
$this->header['Host'] = $domain;
if (strpos($path, '/') !== 0) {
$path = '/' . $path;