This commit is contained in:
Alexandre Saelens 2020-01-22 12:07:07 +13:00
parent a73fa23a76
commit 153752e81d

View File

@ -33,11 +33,11 @@ class CurlLinkChecker implements LinkChecker
/** /**
* Allow to pass custom header to be in CURL request * Allow to pass custom header to be in CURL request
* *
* @config * @config
* @var array * @var array
*/ */
private static $headers = []; private static $headers = [];
/** /**
* Return cache * Return cache
@ -83,11 +83,11 @@ class CurlLinkChecker implements LinkChecker
// Add headers // Add headers
$headers = (array) $this->config()->get('headers'); $headers = (array) $this->config()->get('headers');
if (!empty($headers)) { if (!empty($headers)) {
array_walk($headers, function(&$value, $header) { array_walk($headers, function (&$value, $header) {
$value = "$header: $value"; $value = "$header: $value";
}); });
curl_setopt($handle, CURLOPT_HTTPHEADER , $headers); curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
} }
// Retrieve http code // Retrieve http code
curl_exec($handle); curl_exec($handle);