This commit is contained in:
2020-11-17 18:44:17 +08:00
parent efe2143a53
commit 7a6ca96ac3
+6 -2
View File
@@ -412,6 +412,12 @@ abstract class ClientAbstracts extends Component implements IClient
*/ */
public function getPort(): int public function getPort(): int
{ {
if ($this->isSSL()) {
return 443;
}
if (empty($this->port)) {
return 80;
}
return $this->port; return $this->port;
} }
@@ -741,9 +747,7 @@ abstract class ClientAbstracts extends Component implements IClient
private function defaultString($string) private function defaultString($string)
{ {
$host = $this->getHost(); $host = $this->getHost();
if (!empty($this->port) && $this->port != 443) {
$host .= ':' . $this->getPort(); $host .= ':' . $this->getPort();
}
if ($string == '/') { if ($string == '/') {
$string = ''; $string = '';
} else if (strpos($string, '/') !== 0) { } else if (strpos($string, '/') !== 0) {