Skip to content

Commit

Permalink
Merge pull request #13 from XueSiLf/master
Browse files Browse the repository at this point in the history
fix:can't support https
  • Loading branch information
kiss291323003 authored Jul 12, 2021
2 parents f55d006 + 5514109 commit 3bca1b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,10 @@ public function request(AbstractEndpoint $endpoint): Response

$httpClient = new HttpClient($url);

if ($this->config->getScheme() === 'https') {
$httpClient->setEnableSSL(true);
}

if ($this->config->getUsername() && $this->config->getPassword()){
$httpClient->setHeader('authorization','Basic ' . base64_encode($this->config->getUsername().':'.$this->config->getPassword()), false);
}
Expand Down Expand Up @@ -517,4 +521,4 @@ public function request(AbstractEndpoint $endpoint): Response
}
return $response;
}
}
}

0 comments on commit 3bca1b0

Please sign in to comment.