Skip to content

Commit

Permalink
bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Nov 7, 2022
1 parent abc5be3 commit 64ca478
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/BucketClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public function __construct($config)
throw new InvalidConfigException('No bucket configured.');
}

parent::__construct($config);

$this->setBaseUri(\sprintf(
'https://%s-%s.cos.%s.myqcloud.com/',
$config->get('bucket'),
Expand Down
2 changes: 2 additions & 0 deletions src/JobClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public function __construct($config)

$this->validateConfig($config);

parent::__construct($config);

$this->setBaseUri(\sprintf(
'https://%s.cos-control.%s.myqcloud.com/',
$config->get('uin'),
Expand Down
2 changes: 2 additions & 0 deletions src/ObjectClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public function __construct($config)
throw new InvalidConfigException('No bucket configured.');
}

parent::__construct($config);

$this->setBaseUri(\sprintf(
'https://%s-%s.cos.%s.myqcloud.com/',
$config->get('bucket'),
Expand Down
2 changes: 2 additions & 0 deletions tests/BucketClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public function testBaseUri()
'bucket' => 'test',
'app_id' => '123456',
'region' => 'ap-guangzhou',
'secret_id' => 'test',
'secret_key' => 'test',
]);

$this->assertSame('https://test-123456.cos.ap-guangzhou.myqcloud.com/', $bucketClient->getBaseUri());
Expand Down
2 changes: 2 additions & 0 deletions tests/JobClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public function testBaseUri()
'app_id' => 1250000000,
'uin' => 1000000000,
'region' => 'ap-guangzhou',
'secret_id' => 'test',
'secret_key' => 'test',
]);

$this->assertSame('https://1000000000.cos-control.ap-guangzhou.myqcloud.com/', $client->getBaseUri());
Expand Down
2 changes: 2 additions & 0 deletions tests/ObjectClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public function testBaseUri()
$client = new ObjectClient([
'bucket' => 'test',
'app_id' => '123456',
'secret_id' => 'test',
'secret_key' => 'test',
]);

$this->assertSame('https://test-123456.cos.ap-guangzhou.myqcloud.com/', $client->getBaseUri());
Expand Down

0 comments on commit 64ca478

Please sign in to comment.