on develop help sign in
Add xmlHttpRequestSetWithCredentials to src-ghc
commitd94f3a73f59ac57a7c9b9f60619b1c5ac0ee2192 authorAli Abrar <aliabrar@gmail.com> dateFri 13 May 2016, 07:53 (10 years ago) parentc647f8f
1 file changed+10
src-ghc/Reflex/Dom/Xhr/Foreign.hs+10
src-ghc/Reflex/Dom/Xhr/Foreign.hs+10
@@ -204,3 +204,13 @@ xmlHttpRequestGetStatusText xhr = do
204204 _ <- jsstringgetutf8cstring'_ j ps (fromIntegral l)
205205 peekCString ps
206206 return $ T.pack s
207+
208+xmlHttpRequestSetWithCredentials :: XMLHttpRequest -> Bool -> IO ()
209+xmlHttpRequestSetWithCredentials xhr b = do
210+ let c = xhrContext xhr
211+ b' <- jsvaluemakeboolean c b
212+ o <- toJSObject c [xhrValue xhr, b']
213+ script <- jsstringcreatewithutf8cstring "this[0].withCredentials = this[1]"
214+ _ <- jsevaluatescript c script o nullPtr 1 nullPtr
215+ return ()
216+