importfeed --relaxed: Avoid hitting the urls of items in the feed.

This commit is contained in:
Joey Hess 2015-08-19 12:24:55 -04:00
parent f30a7ccc42
commit 0f5d6c09ac
7 changed files with 16 additions and 4 deletions

View file

@ -182,7 +182,7 @@ startWeb o s = go $ fromMaybe bad $ parseURI urlstring
regulardownload url = do
pathmax <- liftIO $ fileNameLengthLimit "."
urlinfo <- if relaxedOption o
then pure $ Url.UrlInfo True Nothing Nothing
then pure Url.assumeUrlExists
else Url.withUrlOptions (Url.getUrlInfo urlstring)
file <- adjustFile o <$> case fileOption o of
Just f -> pure f

View file

@ -172,7 +172,9 @@ performDownload opts cache todownload = case location todownload of
r <- Remote.claimingUrl url
if Remote.uuid r == webUUID || rawOption opts
then do
urlinfo <- Url.withUrlOptions (Url.getUrlInfo url)
urlinfo <- if relaxedOption opts
then pure Url.assumeUrlExists
else Url.withUrlOptions (Url.getUrlInfo url)
maybeToList <$> addUrlFile (relaxedOption opts) url urlinfo f
else do
res <- tryNonAsync $ maybe