This commit is contained in:
Alexandre Saelens 2020-01-22 12:07:07 +13:00
parent a73fa23a76
commit 153752e81d
1 changed files with 5 additions and 5 deletions

View File

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