Skip to content

Commit

Permalink
Merge pull request #2 from picklecillo/main
Browse files Browse the repository at this point in the history
fix(curl): Use `CURLOPT_USERPWD`
  • Loading branch information
craftzdog authored May 24, 2021
2 parents 3268f0d + c40958c commit d97b6cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ function __construct ( $hostname, $port, $username, $password ) {
public function search($query) {
$wf = new Workflows();

$baseUrl = "http://{$this->username}:{$this->password}@{$this->hostname}:{$this->port}";
$json = $wf->request( $baseUrl."/notes/?limit=20&keyword=".urlencode( $query ) );
$authOptions = [CURLOPT_USERPWD => "{$this->username}:{$this->password}"];

$baseUrl = "http://{$this->hostname}:{$this->port}";
$json = $wf->request( $baseUrl."/notes/?limit=20&keyword=".urlencode( $query ) , $authOptions);
$json = json_decode($json);
$int = 1;

Expand Down

0 comments on commit d97b6cb

Please sign in to comment.