mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
Allow curl to follow redirects.
download.opensuse.org uses redirects to point to the relevant mirror. Adding -L --max-redirs 5 to curl options will get us the requested images.
This commit is contained in:
committed by
Pino Toscano
parent
268de62db6
commit
fb9c17c8d4
@@ -94,7 +94,7 @@ and download_to t ?(progress_bar = false) ~proxy uri filename =
|
||||
| _ as protocol -> (* Any other protocol. *)
|
||||
let outenv = proxy_envvar protocol proxy in
|
||||
(* Get the status code first to ensure the file exists. *)
|
||||
let cmd = sprintf "%s%s%s -g -o /dev/null -I -w '%%{http_code}' %s"
|
||||
let cmd = sprintf "%s%s%s -L --max-redirs 5 -g -o /dev/null -I -w '%%{http_code}' %s"
|
||||
outenv
|
||||
t.curl
|
||||
(if verbose () then "" else " -s -S")
|
||||
@@ -114,7 +114,7 @@ and download_to t ?(progress_bar = false) ~proxy uri filename =
|
||||
error (f_"failed to download %s: HTTP status code %s") uri status_code;
|
||||
|
||||
(* Now download the file. *)
|
||||
let cmd = sprintf "%s%s%s -g -o %s %s"
|
||||
let cmd = sprintf "%s%s%s -L --max-redirs 5 -g -o %s %s"
|
||||
outenv
|
||||
t.curl
|
||||
(if verbose () then "" else if progress_bar then " -#" else " -s -S")
|
||||
|
||||
Reference in New Issue
Block a user