add clear
This commit is contained in:
@@ -657,15 +657,11 @@ class HttpClient
|
|||||||
curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); // 超时设置
|
curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); // 超时设置
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeout); // 超时设置
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeout); // 超时设置
|
||||||
}
|
}
|
||||||
curl_setopt($ch, CURLOPT_HEADER, true);
|
|
||||||
|
|
||||||
var_dump($url, $this->parseHeaderMat());
|
curl_setopt($ch, CURLOPT_HEADER, true);
|
||||||
if ($headers = $this->parseHeaderMat()) {
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $this->parseHeaderMat());
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
curl_setopt($ch, CURLOPT_USERAGENT, $this->agent);
|
||||||
}
|
|
||||||
if (!empty($this->agent)) {
|
|
||||||
curl_setopt($ch, CURLOPT_USERAGENT, $this->agent);
|
|
||||||
}
|
|
||||||
if (file_exists($cert = $this->getSslCertFile())) {
|
if (file_exists($cert = $this->getSslCertFile())) {
|
||||||
curl_setopt($ch, CURLOPT_SSLCERT, $cert);
|
curl_setopt($ch, CURLOPT_SSLCERT, $cert);
|
||||||
}
|
}
|
||||||
@@ -986,7 +982,7 @@ class HttpClient
|
|||||||
}
|
}
|
||||||
$headers = [];
|
$headers = [];
|
||||||
foreach ($this->header as $key => $val) {
|
foreach ($this->header as $key => $val) {
|
||||||
$header = $key . ':' . $val;
|
$header = $key . ': ' . $val;
|
||||||
if (in_array($header, $headers)) {
|
if (in_array($header, $headers)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user