diff options
author | Joey Hess <joey@kitenet.net> | 2012-12-01 17:12:41 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-12-01 17:12:41 -0400 |
commit | 2aeda930371a945cafc1bf3ca5ea1485abdda12b (patch) | |
tree | e0a0eaf72851680542f506369a693272aa304e7b /Remote/WebDAV.hs | |
parent | e2eed1bd95c412fcb70776b217b16ccbb894e6cc (diff) |
webdav: Avoid trying to set props, avoiding incompatability with livedrive.com. Needs DAV version 0.3.
Diffstat (limited to 'Remote/WebDAV.hs')
-rw-r--r-- | Remote/WebDAV.hs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/Remote/WebDAV.hs b/Remote/WebDAV.hs index 0611a3e56..391027d78 100644 --- a/Remote/WebDAV.hs +++ b/Remote/WebDAV.hs @@ -14,8 +14,6 @@ import qualified Data.Map as M import qualified Data.ByteString.UTF8 as B8 import qualified Data.ByteString.Lazy.UTF8 as L8 import qualified Data.ByteString.Lazy as L -import qualified Data.Text.Lazy as LT -import qualified Text.XML as XML import Network.URI (normalizePathSegments) import qualified Control.Exception as E import Network.HTTP.Conduit (HttpException(..)) @@ -109,8 +107,8 @@ storeHelper r k baseurl user pass b = catchBoolIO $ do void $ catchMaybeHttp (deleteContent desturl user pass) davMkdir (urlParent desturl) user pass moveContent srcurl (B8.fromString desturl) user pass - storehttp url v = putContentAndProps url user pass - (noProps, (contentType, v)) + storehttp url v = putContent url user pass + (contentType, v) retrieveCheap :: Remote -> Key -> FilePath -> Annex Bool retrieveCheap _ _ _ = return False @@ -293,8 +291,8 @@ testDav :: String -> Maybe CredPair -> Annex () testDav baseurl (Just (u, p)) = do showSideAction "testing WebDAV server" test "make directory" $ davMkdir baseurl user pass - test "write file" $ putContentAndProps testurl user pass - (noProps, (contentType, L.empty)) + test "write file" $ putContent testurl user pass + (contentType, L.empty) test "delete file" $ deleteContent testurl user pass where test desc a = liftIO $ @@ -311,11 +309,6 @@ testDav _ Nothing = error "Need to configure webdav username and password." contentType :: Maybe B8.ByteString contentType = Just $ B8.fromString "application/octet-stream" -{- The DAV library requires that properties be specified when storing a file. - - This just omits any real properties. -} -noProps :: XML.Document -noProps = XML.parseText_ XML.def $ LT.pack "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<propertyupdate/>" - getCreds :: RemoteConfig -> UUID -> Annex (Maybe CredPair) getCreds c u = getRemoteCredPairFor "webdav" c (davCreds u) |