mirror of
https://github.com/typecho/typecho.git
synced 2025-04-22 10:43:57 +02:00
fix http client cookie
This commit is contained in:
parent
56d7e7eec8
commit
4c4b14020d
@ -39,13 +39,6 @@ class Client
|
||||
*/
|
||||
private string $query;
|
||||
|
||||
/**
|
||||
* User Agent
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private string $agent;
|
||||
|
||||
/**
|
||||
* 设置超时
|
||||
*
|
||||
@ -116,6 +109,7 @@ class Client
|
||||
public function setCookie(string $key, $value): Client
|
||||
{
|
||||
$this->cookies[$key] = $value;
|
||||
$this->setHeader('Cookie', str_replace('&', '; ', http_build_query($this->cookies)));
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -304,10 +298,6 @@ class Client
|
||||
$headers[] = $key . ': ' . $val;
|
||||
}
|
||||
|
||||
if (!empty($this->cookies)) {
|
||||
$headers[] = 'Cookie: ' . str_replace('&', '; ', http_build_query($this->cookies));
|
||||
}
|
||||
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user