瀏覽代碼

download.pl: fix detecting download errors with curl

Avoid treating error pages as successfully downloaded content

Signed-off-by: Felix Fietkau <[email protected]>
Felix Fietkau 8 年之前
父節點
當前提交
74c09e714e
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scripts/download.pl

+ 1 - 1
scripts/download.pl

@@ -82,7 +82,7 @@ sub download_cmd($) {
 	}
 	}
 
 
 	return $have_curl
 	return $have_curl
-		? (qw(curl --connect-timeout 20 --retry 5 --location --insecure), shellwords($ENV{CURL_OPTIONS} || ''), $url)
+		? (qw(curl -f --connect-timeout 20 --retry 5 --location --insecure), shellwords($ENV{CURL_OPTIONS} || ''), $url)
 		: (qw(wget --tries=5 --timeout=20 --no-check-certificate --output-document=-), shellwords($ENV{WGET_OPTIONS} || ''), $url)
 		: (qw(wget --tries=5 --timeout=20 --no-check-certificate --output-document=-), shellwords($ENV{WGET_OPTIONS} || ''), $url)
 	;
 	;
 }
 }