Skip to content

Commit

Permalink
fix:can't support https
Browse files Browse the repository at this point in the history
  • Loading branch information
huanglonghui committed Jul 12, 2021
1 parent f55d006 commit 5514109
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 5514109

Please sign in to comment.