From 619bfaab5bc5e9ef76a78921c5ac2ac35ec6b004 Mon Sep 17 00:00:00 2001 From: Denis Redozubov Date: Fri, 17 May 2019 12:20:27 +0300 Subject: [PATCH] Update request body handling --- .../src/Servant/Client/Internal/JSaddleXhrClient.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/servant-client-jsaddle/src/Servant/Client/Internal/JSaddleXhrClient.hs b/servant-client-jsaddle/src/Servant/Client/Internal/JSaddleXhrClient.hs index 2753ad90..136b2e15 100644 --- a/servant-client-jsaddle/src/Servant/Client/Internal/JSaddleXhrClient.hs +++ b/servant-client-jsaddle/src/Servant/Client/Internal/JSaddleXhrClient.hs @@ -217,8 +217,12 @@ sendXhr xhr (Just body) = do toBody :: Request -> Maybe L.ByteString toBody request = case requestBody request of Nothing -> Nothing - Just (RequestBodyLBS "", _) -> Nothing - Just (RequestBodyLBS x, _) -> Just x + Just (RequestBodyBS "" , _) -> Nothing + Just (RequestBodyBS x , _) -> Just $ L.fromStrict x + -- FIXME: not implemented + Just (RequestBodySource _ , _) -> Nothing + Just (RequestBodyLBS "" , _) -> Nothing + Just (RequestBodyLBS x , _) -> Just x -- * inspecting the xhr response