fb 0.13.4.2 → 0.14
raw patch · 2 files changed
+17/−15 lines, 2 filesdep ~attoparsec-conduitdep ~base16-bytestringdep ~base64-bytestringPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: attoparsec-conduit, base16-bytestring, base64-bytestring, conduit, crypto-api, cryptohash, http-conduit, resourcet
API changes (from Hackage documentation)
Files
- fb.cabal +7/−7
- src/Facebook/Base.hs +10/−8
fb.cabal view
@@ -1,5 +1,5 @@ name: fb-version: 0.13.4.2+version: 0.14 license: BSD3 license-file: LICENSE author: Felipe Lessa@@ -63,17 +63,17 @@ base >= 4 && < 5 , lifted-base >= 0.1 && < 0.3 , bytestring >= 0.9 && < 0.11- , text >= 0.11 && < 0.12+ , text == 0.11.* , transformers >= 0.2 && < 0.4 , transformers-base , monad-control , resourcet- , conduit >= 0.5 && < 0.6+ , conduit == 1.0.* , data-default , http-types- , http-conduit >= 1.5 && < 1.9- , attoparsec >= 0.10 && < 0.11- , attoparsec-conduit >= 0.5 && < 0.6+ , http-conduit == 1.9.*+ , attoparsec == 0.10.*+ , attoparsec-conduit == 1.0.* , unordered-containers , aeson >= 0.5 && < 0.7 , base16-bytestring >= 0.1@@ -81,7 +81,7 @@ , time >= 1.2 && < 1.5 , old-locale , cereal == 0.3.*- , crypto-api == 0.10.*+ , crypto-api == 0.11.* , cryptohash >= 0.7 extensions: DeriveDataTypeable
src/Facebook/Base.hs view
@@ -143,26 +143,29 @@ -> H.Request m -> m (H.Response (C.ResumableSource m ByteString)) fbhttpHelper manager req = do- let req' = req { H.checkStatus = \_ _ -> Nothing }+ let req' = req { H.checkStatus = \_ _ _ -> Nothing } #if DEBUG _ <- liftIO $ printf "fbhttp doing request\n\tmethod: %s\n\tsecure: %s\n\thost: %s\n\tport: %s\n\tpath: %s\n\tqueryString: %s\n\trequestHeaders: %s\n" (show $ H.method req') (show $ H.secure req') (show $ H.host req') (show $ H.port req') (show $ H.path req') (show $ H.queryString req') (show $ H.requestHeaders req') #endif- response@(H.Response status _ headers _) <- H.http req' manager+ response <- H.http req' manager+ let status = H.responseStatus response+ headers = H.responseHeaders response+ cookies = H.responseCookieJar response #if DEBUG _ <- liftIO $ printf "fbhttp response status: %s\n" (show status) #endif if isOkay status then return response else do- let statusexc = H.StatusCodeException status headers+ let statusexc = H.StatusCodeException status headers cookies val <- E.try $ asJsonHelper response case val :: Either E.SomeException FacebookException of Right fbexc -> E.throw fbexc Left _ -> do case AT.parse wwwAuthenticateParser <$> lookup "WWW-Authenticate" headers of- Just (AT.Done _ fbexc) -> E.throw fbexc- _ -> E.throw statusexc+ Just (AT.Done _ fbexc) -> E.throwIO fbexc+ _ -> E.throwIO statusexc -- | Try to parse the @WWW-Authenticate@ header of a Facebook@@ -187,9 +190,8 @@ httpCheck req = runResourceInFb $ do manager <- getManager let req' = req { H.method = HT.methodHead- , H.checkStatus = \_ _ -> Nothing }- H.Response status _ _ _ <- lift (H.httpLbs req' manager)- return $! isOkay status+ , H.checkStatus = \_ _ _ -> Nothing }+ isOkay . H.responseStatus <$> lift (H.httpLbs req' manager) -- Yes, we use httpLbs above so that we don't have to worry -- about consuming the responseBody. Note that the -- responseBody should be empty since we're using HEAD, but