Do one atomic update to the cookie jar for all request and responses.
This commit is contained in:
parent
c33f27de04
commit
8490ccbe93
1 changed files with 3 additions and 2 deletions
|
@ -185,7 +185,8 @@ performRequest req = do
|
|||
now <- getCurrentTime
|
||||
bss <- Client.brConsume $ Client.responseBody fRes
|
||||
let fRes' = fRes { Client.responseBody = BSL.fromChunks bss }
|
||||
mapM_ (atomically . updateCookieJar now) $ Client.hrRedirects responses <> [(fReq, fRes')]
|
||||
allResponses = Client.hrRedirects responses <> [(fReq, fRes')]
|
||||
atomically $ mapM_ (updateCookieJar now) allResponses
|
||||
return fRes'
|
||||
where
|
||||
updateCookieJar :: UTCTime -> (Client.Request, Client.Response BSL.ByteString) -> STM ()
|
||||
|
|
Loading…
Reference in a new issue