git.iko.soy/typeable/servant-reflex
on master help sign in
Check in
commitd7614ff76fff4fcffb808f0e9935a4309ceab72f authorGreg Hale <imalsogreg@gmail.com> dateMon 29 Aug 2016, 16:46 (10 years ago) parentbd66518
2 files changed+13−7
servant-reflex.cabal+2−2 src/Servant/Common/Req.hs+11−5
servant-reflex.cabal+2−2
@@ -32,8 +32,8 @@ library
3232 http-media >= 0.6 && < 0.7,
3333 mtl >= 2.2.1 && < 2.3,
3434 network-uri >= 2.6 && < 2.7,
35− reflex >= 0.4 && < 0.5,
36− reflex-dom == 0.3 && < 0.4,
35+ reflex >= 0.5 && < 0.6,
36+ reflex-dom == 0.4 && < 0.5,
3737 safe >= 0.3.9 && < 0.4,
3838 servant >= 0.5 && < 0.9,
3939 string-conversions >= 0.4 && < 0.5,
src/Servant/Common/Req.hs+11−5
@@ -77,7 +77,7 @@ prependToPathParts p req =
7777 req { reqPathParts = p : reqPathParts req }
7878
7979addHeader :: (ToHttpApiData a, Reflex t) => Text -> Dynamic t (Either Text a) -> Req t -> Req t
80−addHeader name val req = req { headers = (name, (fmap . fmap) (unpack . toHeader) val) : headers req }
80+addHeader name val req = req { headers = (name, (fmap . fmap) toHeader val) : headers req }
8181
8282
8383-- * performing requests
@@ -144,14 +144,20 @@ performRequest reqMeth req reqHost trigger = do
144144
145145 mkConfigBody :: Either Text [(Text,Text)]
146146 -> (Either Text (BL.ByteString, Text))
147− -> Either Text XhrRequestConfig
147+ -> Either Text (XhrRequestConfig LT.Text)
148148 mkConfigBody ehs rb = case (ehs, rb) of
149149 (_, Left e) -> Left e
150150 (Left e, _) -> Left e
151151 (Right hs, Right (bBytes, bCT)) ->
152− Right $ def { _xhrRequestConfig_sendData = Just (BL.unpack bBytes)
153− , _xhrRequestConfig_headers =
154− Map.insert "Content-Type" bCT (Map.fromList hs)}
152+ Right $ XhrRequestConfig
153+ { _xhrRequestConfig_sendData = Just (BL.unpack bBytes)
154+ , _xhrRequestConfig_headers =
155+ Map.insert "Content-Type" bCT (Map.fromList hs)
156+ , _xhrRequestConfig_password = Nothing
157+ , _xhrRequestConfig_responseType = Nothing
158+ , _xhrRequestConfig_withCredentials = False
159+ , _xhrRequestConfig_responseHeaders = def
160+ }
155161
156162 xhrOpts :: Dynamic t (Either Text (XhrRequestConfig LT.Text))
157163 xhrOpts = case reqBody req of