diff --git a/src/Database/Bloodhound/Client.hs b/src/Database/Bloodhound/Client.hs index 7af3b73..e987c4b 100644 --- a/src/Database/Bloodhound/Client.hs +++ b/src/Database/Bloodhound/Client.hs @@ -176,9 +176,9 @@ dispatch dMethod url body = do initReq <- liftIO $ parseUrl' url reqHook <- bhRequestHook <$> getBHEnv let reqBody = RequestBodyLBS $ fromMaybe emptyBody body - req <- reqHook $ initReq { method = dMethod - , requestBody = reqBody - , checkStatus = \_ _ _ -> Nothing} + req <- liftIO $ reqHook $ initReq { method = dMethod + , requestBody = reqBody + , checkStatus = \_ _ _ -> Nothing} mgr <- bhManager <$> getBHEnv liftIO $ httpLbs req mgr diff --git a/src/Database/Bloodhound/Types/Internal.hs b/src/Database/Bloodhound/Types/Internal.hs index 9e95549..66769c9 100644 --- a/src/Database/Bloodhound/Types/Internal.hs +++ b/src/Database/Bloodhound/Types/Internal.hs @@ -2,7 +2,6 @@ {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -{-# LANGUAGE RankNTypes #-} ------------------------------------------------------------------------------- -- | @@ -34,7 +33,7 @@ import Network.HTTP.Client -} data BHEnv = BHEnv { bhServer :: Server , bhManager :: Manager - , bhRequestHook :: forall m. (MonadBH m) => Request -> m Request + , bhRequestHook :: Request -> IO Request -- ^ Low-level hook that is run before every request is sent. Used to implement custom authentication strategies. Defaults to 'return' with 'mkBHEnv'. }