Upgrade to Kirby 3.3.2
This commit is contained in:
@@ -22,16 +22,17 @@ class Remote
|
||||
* @var array
|
||||
*/
|
||||
public static $defaults = [
|
||||
'agent' => null,
|
||||
'body' => true,
|
||||
'data' => [],
|
||||
'encoding' => 'utf-8',
|
||||
'file' => null,
|
||||
'headers' => [],
|
||||
'method' => 'GET',
|
||||
'progress' => null,
|
||||
'test' => false,
|
||||
'timeout' => 10,
|
||||
'agent' => null,
|
||||
'basicAuth' => null,
|
||||
'body' => true,
|
||||
'data' => [],
|
||||
'encoding' => 'utf-8',
|
||||
'file' => null,
|
||||
'headers' => [],
|
||||
'method' => 'GET',
|
||||
'progress' => null,
|
||||
'test' => false,
|
||||
'timeout' => 10,
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -170,7 +171,22 @@ class Remote
|
||||
|
||||
// add all headers
|
||||
if (empty($this->options['headers']) === false) {
|
||||
$this->curlopt[CURLOPT_HTTPHEADER] = $this->options['headers'];
|
||||
// convert associative arrays to strings
|
||||
$headers = [];
|
||||
foreach ($this->options['headers'] as $key => $value) {
|
||||
if (is_string($key) === true) {
|
||||
$headers[] = $key . ': ' . $value;
|
||||
} else {
|
||||
$headers[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$this->curlopt[CURLOPT_HTTPHEADER] = $headers;
|
||||
}
|
||||
|
||||
// add HTTP Basic authentication
|
||||
if (empty($this->options['basicAuth']) === false) {
|
||||
$this->curlopt[CURLOPT_USERPWD] = $this->options['basicAuth'];
|
||||
}
|
||||
|
||||
// add the user agent
|
||||
|
Reference in New Issue
Block a user