Skip to content

Commit

Permalink
fix issue 404
Browse files Browse the repository at this point in the history
  • Loading branch information
freyo authored May 7, 2019
1 parent 9003b53 commit eadff52
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Queue/Driver/CMQClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,23 @@ public function __construct($host, $secretId, $secretKey, $version = 'SDK_PHP_1.
$this->version = $version;
$this->method = $method;
$this->sign_method = 'HmacSHA1';
$this->http = new CMQHttp($this->host);
$this->http = new CMQHttp($host);
}

protected function process_host($host)
{
if (strpos($host, 'http://') === 0 || strpos($host, 'https://') === 0) {
$this->host = rtrim($host, '/');
if (strpos($host, 'http://') === 0) {
$_host = substr($host, 7, strlen($host) - 7);
} elseif (strpos($host, 'https://') === 0) {
$_host = substr($host, 8, strlen($host) - 8);
} else {
throw new CMQClientParameterException('Only support http(s) prototol. Invalid endpoint:'.$host);
}
if ($_host[strlen($_host) - 1] == '/') {
$this->host = substr($_host, 0, strlen($_host) - 1);
} else {
$this->host = $_host;
}
}

public function set_sign_method($sign_method = 'sha1')
Expand Down

0 comments on commit eadff52

Please sign in to comment.