From 93def0dfc839467d2309d130eaac44cbff3c8e6c Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Sat, 19 Jan 2019 02:33:20 +0000 Subject: [PATCH] When doing httpJSON to GET keyId, use appHttpManager, not the silly global one --- src/Vervis/Handler/Inbox.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Vervis/Handler/Inbox.hs b/src/Vervis/Handler/Inbox.hs index e07ed54..f627327 100644 --- a/src/Vervis/Handler/Inbox.hs +++ b/src/Vervis/Handler/Inbox.hs @@ -40,7 +40,7 @@ import Data.Time.Clock (UTCTime, getCurrentTime) import Data.Time.Interval (TimeInterval, toTimeUnit) import Data.Time.Units (Second) import Network.HTTP.Client (Manager, HttpException, requestFromURI) -import Network.HTTP.Simple (httpJSONEither, getResponseBody) +import Network.HTTP.Simple (httpJSONEither, getResponseBody, setRequestManager) import Network.URI (URI (uriFragment), parseURI) import Text.Blaze.Html (Html) import UnliftIO.Exception (try) @@ -155,7 +155,8 @@ postInboxR = do u <- liftE $ case parseURI $ BC.unpack keyid of Nothing -> Left "keyId in Sig header isn't a valid absolute URI" Just uri -> Right uri - response <- ExceptT $ first (displayException :: HttpException -> String) <$> (try $ httpJSONEither =<< requestFromURI u) + manager <- getsYesod appHttpManager + response <- ExceptT $ first (displayException :: HttpException -> String) <$> (try $ httpJSONEither . setRequestManager manager =<< requestFromURI u) liftE $ do actor <- first displayException $ getResponseBody response let uActor = u { uriFragment = "" }