3
This commit is contained in:
@@ -337,7 +337,9 @@ class HttpClient
|
|||||||
if (empty($string)) {
|
if (empty($string)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!$this->use_swoole) {
|
||||||
|
return $this->host . '/' . ltrim($string, '/');
|
||||||
|
}
|
||||||
if ($this->isHttp($string)) {
|
if ($this->isHttp($string)) {
|
||||||
$string = str_replace('http://', '', $string);
|
$string = str_replace('http://', '', $string);
|
||||||
$hostAndUrls = explode('/', $string);
|
$hostAndUrls = explode('/', $string);
|
||||||
@@ -398,10 +400,14 @@ class HttpClient
|
|||||||
return $this->curl($url, $data);
|
return $this->curl($url, $data);
|
||||||
}
|
}
|
||||||
$url = $this->matchHost(ltrim($url, '/'));
|
$url = $this->matchHost(ltrim($url, '/'));
|
||||||
if (!empty($this->port)) {
|
// if (!empty($this->port)) {
|
||||||
$this->host .= ':' . $this->port;
|
// $this->host .= ':' . $this->port;
|
||||||
|
// }
|
||||||
|
if ($this->isSSL) {
|
||||||
|
return $this->curl('https://' . $url, $data);
|
||||||
|
} else {
|
||||||
|
return $this->curl('http://' . $url, $data);
|
||||||
}
|
}
|
||||||
return $this->curl('http://' . $this->host . '/' . $url, $data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user