aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-07-01 21:52:27 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-07-01 21:52:27 -0400
commite6b9539a655f15c402aad3f5fa3690c8e4fb06aa (patch)
treeaa9bdc9128cf54c5287834772f750c230bb10bb8
parentace9de37e8db9c99db4b121392ca63091e48bfac (diff)
make curl follow redirs
-rw-r--r--Remote/Web.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Remote/Web.hs b/Remote/Web.hs
index 304f191d3..71591b7aa 100644
--- a/Remote/Web.hs
+++ b/Remote/Web.hs
@@ -115,6 +115,7 @@ urlexists url = do
_ <- setopt curl (CurlURL url)
_ <- setopt curl (CurlNoBody True)
_ <- setopt curl (CurlFailOnError True)
+ _ <- setopt curl (CurlFollowLocation True)
res <- perform curl
return $ res == CurlOK
@@ -122,5 +123,5 @@ download :: [URLString] -> FilePath -> Annex Bool
download [] _ = return False
download (url:us) file = do
showProgress -- make way for curl progress bar
- ok <- liftIO $ boolSystem "curl" [Params "-C - -# -o", File file, File url]
+ ok <- liftIO $ boolSystem "curl" [Params "-L -C - -# -o", File file, File url]
if ok then return ok else download us file