Skip to content

Commit b8131bf

Browse files
krwulewzylu
authored andcommitted
Fix(Exception): 'NoSuchBucket' exception is thrown when an object doesn't exists. (#33)
1 parent b766978 commit b8131bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Qcloud/Cos/ExceptionParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function parseHeaders(RequestInterface $request, Response $response, a
6464
} elseif ($method === 'HEAD' && $status === 404) {
6565
$path = explode('/', trim($request->getPath(), '/'));
6666
$host = explode('.', $request->getHost());
67-
$bucket = (count($host) === 4) ? $host[0] : array_shift($path);
67+
$bucket = (count($host) >= 4) ? $host[0] : array_shift($path);
6868
$object = array_shift($path);
6969

7070
if ($bucket && $object) {

0 commit comments

Comments
 (0)