Skip to content

Commit

Permalink
Added basic auth curl option user:password if is set env variables AP…
Browse files Browse the repository at this point in the history
…P_USER and APP_PASSWORD;
  • Loading branch information
polinart committed Jul 23, 2019
1 parent 55ef3ed commit 69ec5aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/RedirectHealthChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ public function isPageAlive($url) {
CURLOPT_TIMEOUT => 1000
]);

if(env('APP_USER') && env('APP_PASSWORD')) {
curl_setopt($curl, CURLOPT_USERPWD, env('APP_USER') . ":" . env('APP_PASSWORD'));
}

if (!curl_exec($curl)) {
$this->errors[$url] = 'Error: "' . curl_error($curl) . '" - Code: ' . curl_errno($curl);
return false;
Expand Down

0 comments on commit 69ec5aa

Please sign in to comment.