Skip to content

Commit 24baaf3

Browse files
committed
fix read empty dir bug
1 parent 129fa7a commit 24baaf3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Upyun/Upyun.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function read($path, $saveHandler = NULL, $params = array()) {
129129
return $response->getBody()->getContents();
130130
}
131131
} else {
132-
$files = Util::parseDir($response->getBody());
132+
$files = Util::parseDir($response->getBody()->getContents());
133133
return array('files' => $files, 'is_end' => $params['x-upyun-list-iter'] === 'g2gCZAAEbmV4dGQAA2VvZg', 'iter' => $params['x-upyun-list-iter']);
134134
}
135135
}

src/Upyun/Util.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static function getHeaderParams($headers) {
2424
public static function parseDir($body) {
2525
$files = array();
2626
if(!$body) {
27-
return array('files' => $files, 'is_end' => true);
27+
return array();
2828
}
2929

3030
$lines = explode("\n", $body);

0 commit comments

Comments
 (0)