DAV 0.5 → 0.5.1
raw patch · 3 files changed
+10/−10 lines, 3 filesdep +http-client-tlsdep −http-conduit
Dependencies added: http-client-tls
Dependencies removed: http-conduit
Files
- DAV.cabal +4/−4
- Network/Protocol/HTTP/DAV.hs +5/−5
- Network/Protocol/HTTP/DAV/TH.hs +1/−1
DAV.cabal view
@@ -1,5 +1,5 @@ name: DAV-version: 0.5+version: 0.5.1 synopsis: RFC 4918 WebDAV support description: This is a library for the Web Distributed Authoring and Versioning@@ -30,7 +30,7 @@ , case-insensitive >= 0.4 , containers , http-client >= 0.2- , http-conduit >= 2+ , http-client-tls >= 0.2 , http-types >= 0.7 , lens >= 3.0 , lifted-base >= 0.1@@ -48,7 +48,7 @@ , case-insensitive >= 0.4 , containers , http-client >= 0.2- , http-conduit >= 2+ , http-client-tls >= 0.2 , http-types >= 0.7 , lens >= 3.0 , lifted-base >= 0.1@@ -68,4 +68,4 @@ source-repository this type: git location: git://anonscm.debian.org/users/clint/DAV.git- tag: DAV/0.5+ tag: DAV/0.5.1
Network/Protocol/HTTP/DAV.hs view
@@ -38,7 +38,7 @@ import Control.Exception.Lifted (catchJust, finally, bracketOnError) import Control.Lens ((.~), (^.)) import Control.Monad (when)-import Control.Monad.Trans (lift)+import Control.Monad.IO.Class (liftIO) import Control.Monad.Trans.Resource (MonadResourceBase, ResourceT, runResourceT, allocate) import Control.Monad.Trans.State.Lazy (evalStateT, StateT, get, modify) @@ -49,8 +49,8 @@ import Data.Maybe (catMaybes, fromMaybe) -import Network.HTTP.Client (defaultManagerSettings, RequestBody(..))-import Network.HTTP.Conduit (httpLbs, parseUrl, applyBasicAuth, Request(..), Response(..), newManager, closeManager, ManagerSettings(..), HttpException(..))+import Network.HTTP.Client (RequestBody(..), httpLbs, parseUrl, applyBasicAuth, Request(..), Response(..), newManager, closeManager, ManagerSettings(..), HttpException(..))+import Network.HTTP.Client.TLS (tlsManagerSettings) import Network.HTTP.Types (hContentType, Method, Status, RequestHeaders, unauthorized401, conflict409) import qualified Text.XML as XML@@ -72,7 +72,7 @@ withDS :: MonadResourceBase m => String -> B.ByteString -> B.ByteString -> Maybe Depth -> DAVState m a -> m a withDS url username password md f = runResourceT $ do- (_, ds) <- allocate (initialDS url username password md defaultManagerSettings) closeDS+ (_, ds) <- allocate (initialDS url username password md tlsManagerSettings) closeDS evalStateT f ds davRequest :: MonadResourceBase m => Method -> RequestHeaders -> RequestBody -> DAVState m (Response BL.ByteString)@@ -84,7 +84,7 @@ ] ++ addlhdrs req = (ctx ^. baseRequest) { method = meth, requestHeaders = hdrs, requestBody = rbody } authreq = applyBasicAuth (ctx ^. basicusername) (ctx ^. basicpassword) req- resp <- lift (catchJust (matchStatusCodeException unauthorized401)+ resp <- liftIO (catchJust (matchStatusCodeException unauthorized401) (httpLbs req (ctx ^. httpManager)) (\_ -> httpLbs authreq (ctx ^. httpManager))) return resp
Network/Protocol/HTTP/DAV/TH.hs view
@@ -22,7 +22,7 @@ import Control.Lens (makeLenses) import qualified Data.ByteString as B-import Network.HTTP.Conduit (Manager, Request)+import Network.HTTP.Client (Manager, Request) data Depth = Depth0 | Depth1 | DepthInfinity instance Read Depth where