git.iko.soy/typeable/servant-reflex
on master help sign in
Check in
d7614ffGreg Hale
servant-reflex.cabal+2−2
@@ -32,8 +32,8 @@ library
32 http-media >= 0.6 && < 0.7,
32 http-media >= 0.6 && < 0.7,
33 mtl >= 2.2.1 && < 2.3,
33 mtl >= 2.2.1 && < 2.3,
34 network-uri >= 2.6 && < 2.7,
34 network-uri >= 2.6 && < 2.7,
35− reflex >= 0.4 && < 0.5,
35+ reflex >= 0.5 && < 0.6,
36− reflex-dom == 0.3 && < 0.4,
36+ reflex-dom == 0.4 && < 0.5,
37 safe >= 0.3.9 && < 0.4,
37 safe >= 0.3.9 && < 0.4,
38 servant >= 0.5 && < 0.9,
38 servant >= 0.5 && < 0.9,
39 string-conversions >= 0.4 && < 0.5,
39 string-conversions >= 0.4 && < 0.5,
src/Servant/Common/Req.hs+11−5
@@ -77,7 +77,7 @@ prependToPathParts p req =
77 req { reqPathParts = p : reqPathParts req }
77 req { reqPathParts = p : reqPathParts req }
78
78
79addHeader :: (ToHttpApiData a, Reflex t) => Text -> Dynamic t (Either Text a) -> Req t -> Req t
79addHeader :: (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 }
81
81
82
82
83-- * performing requests
83-- * performing requests
@@ -144,14 +144,20 @@ performRequest reqMeth req reqHost trigger = do
144
144
145 mkConfigBody :: Either Text [(Text,Text)]
145 mkConfigBody :: Either Text [(Text,Text)]
146 -> (Either Text (BL.ByteString, Text))
146 -> (Either Text (BL.ByteString, Text))
147− -> Either Text XhrRequestConfig
147+ -> Either Text (XhrRequestConfig LT.Text)
148 mkConfigBody ehs rb = case (ehs, rb) of
148 mkConfigBody ehs rb = case (ehs, rb) of
149 (_, Left e) -> Left e
149 (_, Left e) -> Left e
150 (Left e, _) -> Left e
150 (Left e, _) -> Left e
151 (Right hs, Right (bBytes, bCT)) ->
151 (Right hs, Right (bBytes, bCT)) ->
152+ Right $ XhrRequestConfig
152− Right $ def { _xhrRequestConfig_sendData = Just (BL.unpack bBytes)
153+ { _xhrRequestConfig_sendData = Just (BL.unpack bBytes)
153− , _xhrRequestConfig_headers =
154+ , _xhrRequestConfig_headers =
154− Map.insert "Content-Type" bCT (Map.fromList hs)}
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+ }
155
161
156 xhrOpts :: Dynamic t (Either Text (XhrRequestConfig LT.Text))
162 xhrOpts :: Dynamic t (Either Text (XhrRequestConfig LT.Text))
157 xhrOpts = case reqBody req of
163 xhrOpts = case reqBody req of