diff options
Diffstat (limited to 'Command/AddUrl.hs')
-rw-r--r-- | Command/AddUrl.hs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs index 82b04f07b..f45303416 100644 --- a/Command/AddUrl.hs +++ b/Command/AddUrl.hs @@ -134,8 +134,7 @@ perform relaxed url file = ifAnnexed file addurl geturl setUrlPresent key url next $ return True | otherwise = do - headers <- getHttpHeaders - (exists, samesize) <- Url.withUserAgent $ Url.check url headers $ keySize key + (exists, samesize) <- Url.withUrlOptions $ Url.check url (keySize key) if exists && samesize then do setUrlPresent key url @@ -192,8 +191,7 @@ download url file = do -} addSizeUrlKey :: URLString -> Key -> Annex Key addSizeUrlKey url key = do - headers <- getHttpHeaders - size <- snd <$> Url.withUserAgent (Url.exists url headers) + size <- snd <$> Url.withUrlOptions (Url.exists url) return $ key { keySize = size } cleanup :: URLString -> FilePath -> Key -> Maybe FilePath -> Annex Bool @@ -212,10 +210,9 @@ cleanup url file key mtmp = do nodownload :: Bool -> URLString -> FilePath -> Annex Bool nodownload relaxed url file = do - headers <- getHttpHeaders (exists, size) <- if relaxed then pure (True, Nothing) - else Url.withUserAgent $ Url.exists url headers + else Url.withUrlOptions (Url.exists url) if exists then do key <- Backend.URL.fromUrl url size |