@@ -236,7 +236,6 @@ import Data.ByteString qualified as B
236236import Data.ByteString.Lazy qualified as BL
237237import Data.CaseInsensitive qualified as CI
238238import Data.Data (Data)
239−import Data.Default.Class (def)
240239import Data.Function (on)
241240import Data.IORef
242241import Data.Kind (Constraint, Type)
@@ -585,10 +584,10 @@ req' method url body options m = do
585584 withReqManager (m request)
586585
587586-- | Perform an action using the global implicit 'L.Manager' that the rest
588−-- of the library uses. This allows us to reuse connections that the
587+-- of the library uses. This allows to reuse connections that the
589588-- 'L.Manager' controls.
590589withReqManager :: (MonadIO m) => (L.Manager -> m a) -> m a
591−withReqManager m = m globalManager
590+withReqManager m = liftIO (readIORef globalManager) >>= m
592591
593592-- | The global 'L.Manager' that 'req' uses. Here we just go with the
594593-- default settings, so users don't need to deal with this manager stuff at
@@ -601,16 +600,16 @@ withReqManager m = m globalManager
601600-- manager. From that moment on the 'IORef' will be just reused—exactly the
602601-- behavior we want here in order to maximize connection sharing. GHC could
603602-- spoil the plan by inlining the definition, hence the @NOINLINE@ pragma.
604−globalManager :: L.Manager
603+globalManager :: IORef L.Manager
605604globalManager = unsafePerformIO $ do
606605 context <- NC.initConnectionContext
607606 let settings =
608607 L.mkManagerSettingsContext
609608 (Just context)
610− def
609+ (NC.TLSSettingsSimple False False False)
611610 Nothing
612611 manager <- L.newManager settings
613− return manager
612+ newIORef manager
614613{-# NOINLINE globalManager #-}
615614
616615----------------------------------------------------------------------------
@@ -716,6 +715,7 @@ data HttpConfig = HttpConfig
716715 -- @since 3.6.0
717716 httpConfigBodyPreviewLength :: forall a. (Num a) => a
718717 }
718+ deriving (Typeable)
719719
720720-- | The default value of 'HttpConfig'.
721721--
@@ -1024,7 +1024,7 @@ instance (HttpMethod method) => RequestComponent (Tagged "method" method) where
10241024-- > -- https://%D1%8E%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4.%D1%80%D1%84
10251025data Url (scheme :: Scheme) = Url Scheme (NonEmpty Text)
10261026 -- NOTE The second value is the path segments in reversed order.
1027− deriving (Eq, Ord, Show, Data, Generic)
1027+ deriving (Eq, Ord, Show, Data, Typeable, Generic)
10281028
10291029type role Url nominal
10301030
@@ -2011,7 +2011,7 @@ data HttpException
20112011 | -- | A wrapper with Aeson-produced 'String' describing why decoding
20122012 -- failed
20132013 JsonHttpException String
2014− deriving (Show, Generic)
2014+ deriving (Show, Typeable, Generic)
20152015
20162016instance Exception HttpException
20172017
@@ -2048,4 +2048,4 @@ data Scheme
20482048 Http
20492049 | -- | HTTPS
20502050 Https
2051− deriving (Eq, Ord, Show, Data, Generic, TH.Lift)
2051+ deriving (Eq, Ord, Show, Data, Typeable, Generic, TH.Lift)