diff --git a/src/Qcloud/Cos/ExceptionParser.php b/src/Qcloud/Cos/ExceptionParser.php index af06f0de..ab1cd9b4 100644 --- a/src/Qcloud/Cos/ExceptionParser.php +++ b/src/Qcloud/Cos/ExceptionParser.php @@ -64,7 +64,7 @@ protected function parseHeaders(RequestInterface $request, Response $response, a } elseif ($method === 'HEAD' && $status === 404) { $path = explode('/', trim($request->getPath(), '/')); $host = explode('.', $request->getHost()); - $bucket = (count($host) === 4) ? $host[0] : array_shift($path); + $bucket = (count($host) >= 4) ? $host[0] : array_shift($path); $object = array_shift($path); if ($bucket && $object) {