summaryrefslogtreecommitdiff
path: root/Remote/WebDAV.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-04-30 14:10:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-04-30 14:10:55 -0400
commit62ffc7d3500b726b2744c12356592403dcc71363 (patch)
tree1184b71a74ed15dcb40e14a7a13cb2575f2e5a6f /Remote/WebDAV.hs
parentd12b1fb179bc1744f813ea3f616d503d2b0dfe09 (diff)
Support building with DAV 0.4.
Diffstat (limited to 'Remote/WebDAV.hs')
-rw-r--r--Remote/WebDAV.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Remote/WebDAV.hs b/Remote/WebDAV.hs
index 8af4791c0..52fc32b3a 100644
--- a/Remote/WebDAV.hs
+++ b/Remote/WebDAV.hs
@@ -231,7 +231,7 @@ davUrl :: DavUrl -> FilePath -> DavUrl
davUrl baseurl file = baseurl </> file
davUrlExists :: DavUrl -> DavUser -> DavPass -> IO (Either String Bool)
-davUrlExists url user pass = decode <$> catchHttp (getProps url user pass)
+davUrlExists url user pass = decode <$> catchHttp get
where
decode (Right _) = Right True
#if ! MIN_VERSION_http_conduit(1,9,0)
@@ -241,6 +241,11 @@ davUrlExists url user pass = decode <$> catchHttp (getProps url user pass)
#endif
| statusCode status == statusCode notFound404 = Right False
decode (Left e) = Left $ showEitherException e
+#if ! MIN_VERSION_DAV(0,4,0)
+ get = getProps url user pass
+#else
+ get = getProps url user pass Nothing
+#endif
davGetUrlContent :: DavUrl -> DavUser -> DavPass -> IO (Maybe L.ByteString)
davGetUrlContent url user pass = fmap (snd . snd) <$>