Make curl follow redirections. wget already does.

BUG=chromium-os:10289
TEST=manual

Set up a local URL that redirects, try it out. For example:

  ./recovery.sh http://www/~scottz/recovery2.conf

should redirect to http://www.corp.google.com/~scottz/recovery2.conf

Change-Id: I0a60784f414d69b9e3371b9546666dcdc8978d25

Review URL: http://codereview.chromium.org/5818002
This commit is contained in:
Bill Richardson
2010-12-13 16:21:25 -08:00
parent 841c4115ee
commit 50a75da5a1

View File

@@ -191,10 +191,10 @@ fetch_url() {
if [ -z "$resume" ]; then
# quietly fetch a new copy each time
rm -f "$filename"
curl -f -s -S -o "$filename" "$url"
curl -L -f -s -S -o "$filename" "$url"
else
# continue where we left off, if possible
curl -f -C - -o "$filename" "$url"
curl -L -f -C - -o "$filename" "$url"
# If you give curl the '-C -' option but the file you want is already
# complete and the server doesn't report the total size correctly, it
# will report an error instead of just doing nothing. We'll try to work