@@ -223,7 +223,7 @@ reqToReflexRequest reqMeth reqHost req =
223223 Map.insert "Content-Type" bCT (Map.fromList hs)
224224 , _xhrRequestConfig_user = Nothing
225225 , _xhrRequestConfig_password = Nothing
226− , _xhrRequestConfig_responseType = Nothing
226+ , _xhrRequestConfig_responseType = Just XhrResponseType_ArrayBuffer
227227 , _xhrRequestConfig_withCredentials = False
228228 , _xhrRequestConfig_responseHeaders = def
229229 }
@@ -235,7 +235,7 @@ reqToReflexRequest reqMeth reqHost req =
235235 Right hs -> Right $ def { _xhrRequestConfig_headers = Map.fromList hs
236236 , _xhrRequestConfig_user = Nothing
237237 , _xhrRequestConfig_password = Nothing
238− , _xhrRequestConfig_responseType = Nothing
238+ , _xhrRequestConfig_responseType = Just XhrResponseType_ArrayBuffer
239239 , _xhrRequestConfig_sendData = ""
240240 , _xhrRequestConfig_withCredentials = False
241241 }
@@ -344,15 +344,15 @@ performRequestsCT
344344 -> m (Event t (f (ReqResult tag a)))
345345performRequestsCT ct reqMeth reqs reqHost opts trigger = do
346346 resps <- performRequests reqMeth reqs reqHost opts trigger
347− let decodeResp x = first T.pack .
348− mimeUnrender ct .
349− BL.fromStrict .
350− TE.encodeUtf8 =<< note "No body text"
351− (_xhrResponse_responseText x)
347+ let decodeResp (Just (XhrResponseBody_ArrayBuffer x)) =
348+ first T.pack .
349+ mimeUnrender ct $
350+ BL.fromStrict x
351+ decodeResp _ = Left "No body"
352352 return $ fmap
353353 (\(t,rs) -> ffor rs $ \r -> case r of
354354 Left e -> RequestFailure t e
355− Right g -> evalResponse decodeResp (t,g)
355+ Right g -> evalResponse (decodeResp . _xhrResponse_response) (t,g)
356356 )
357357 resps
358358