Skip to content

Commit 0207d82

Browse files
committed
fix(#19): Avoid read http header when response 3/4/5xx
Change ResponseInterface::getHeaders() #1 parameter to TRUE, then an exception should be thrown on 3/4/5xx status codes Signed-off-by: RazeSoldier <[email protected]>
1 parent 829d76c commit 0207d82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/DownloadTask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct(string $url, string $savePath) {
5353
*/
5454
public function download() {
5555
$resp = $this->makeNormalRequest();
56-
$expectedSize = $resp->getHeaders(false)['content-length'][0];
56+
$expectedSize = $resp->getHeaders(true)['content-length'][0];
5757
$file = fopen($this->savePath, 'w+b');
5858

5959
$this->doTransport($resp, $file);

0 commit comments

Comments
 (0)