File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ http_download_curl() {
301
301
code=$( curl -w ' %{http_code}' -sL -H " $header " -o " $local_file " " $source_url " )
302
302
fi
303
303
if [ " $code " != " 200" ]; then
304
- log_debug " http_download_curl received HTTP status $code "
304
+ log_err " http_download_curl received HTTP status $code "
305
305
return 1
306
306
fi
307
307
return 0
@@ -310,11 +310,24 @@ http_download_wget() {
310
310
local_file=$1
311
311
source_url=$2
312
312
header=$3
313
+ local wget_output
314
+ local code
313
315
if [ -z " $header " ]; then
314
- wget -q - O " $local_file " " $source_url "
316
+ wget_output= $( wget --server-response --quiet - O " $local_file " " $source_url " 2>&1 )
315
317
else
316
- wget -q --header " $header " -O " $local_file " " $source_url "
318
+ wget_output= $( wget --server-response --quiet -- header " $header " -O " $local_file " " $source_url " 2>&1 )
317
319
fi
320
+ local wget_exit=$?
321
+ if [ $wget_exit -ne 0 ]; then
322
+ log_err " http_download_wget failed: wget exited with status $wget_exit "
323
+ return 1
324
+ fi
325
+ code=$( echo " $wget_output " | awk ' /^ HTTP/{print $2}' | tail -n1)
326
+ if [ " $code " != " 200" ]; then
327
+ log_err " http_download_wget received HTTP status $code "
328
+ return 1
329
+ fi
330
+ return 0
318
331
}
319
332
http_download () {
320
333
log_debug " http_download $2 "
You can’t perform that action at this time.
0 commit comments