@@ -179,16 +179,16 @@ newXMLHttpRequestWithError req cb = do
179 status <- liftIO $ xmlHttpRequestGetStatus xhr
179 status <- liftIO $ xmlHttpRequestGetStatus xhr
180 statusText <- liftIO $ xmlHttpRequestGetStatusText xhr
180 statusText <- liftIO $ xmlHttpRequestGetStatusText xhr
181 when (readyState == 4) $ do
181 when (readyState == 4) $ do
182− t <- if rt == Just XhrResponseType_Text || rt == Nothing
182+ t <- if rt == Just XhrResponseType_Text || isNothing rt
183 then liftIO $ xmlHttpRequestGetResponseText xhr
183 then liftIO $ xmlHttpRequestGetResponseText xhr
184 else return Nothing
184 else return Nothing
185 r <- liftIO $ xmlHttpRequestGetResponse xhr
185 r <- liftIO $ xmlHttpRequestGetResponse xhr
186 h <- case _xhrRequestConfig_responseHeaders c of
186 h <- case _xhrRequestConfig_responseHeaders c of
187− AllHeaders -> liftIO $ fmap parseAllHeadersString $
187+ AllHeaders -> liftIO $ parseAllHeadersString <$>
188 xmlHttpRequestGetAllResponseHeaders xhr
188 xmlHttpRequestGetAllResponseHeaders xhr
189− OnlyHeaders xs -> liftIO $ fmap Map.fromList $ traverse
189+ OnlyHeaders xs -> liftIO $ Map.fromList <$> traverse
190 (\x -> (x,) <$> xmlHttpRequestGetResponseHeader xhr x) xs
190 (\x -> (x,) <$> xmlHttpRequestGetResponseHeader xhr x) xs
191− _ <- liftIO $ cb $ Right $
191+ _ <- liftIO $ cb $ Right
192 XhrResponse { _xhrResponse_status = status
192 XhrResponse { _xhrResponse_status = status
193 , _xhrResponse_statusText = statusText
193 , _xhrResponse_statusText = statusText
194 , _xhrResponse_response = r
194 , _xhrResponse_response = r
@@ -201,7 +201,7 @@ newXMLHttpRequestWithError req cb = do
201 return xhr
201 return xhr
203parseAllHeadersString :: Text -> Map Text Text
203parseAllHeadersString :: Text -> Map Text Text
204−parseAllHeadersString s = Map.fromList $ fmap (stripBoth . (T.span (/=':'))) $
204+parseAllHeadersString s = Map.fromList $ fmap (stripBoth . T.span (/=':')) $
205 dropWhileEnd T.null $ T.splitOn (T.pack "\r\n") s
205 dropWhileEnd T.null $ T.splitOn (T.pack "\r\n") s
206 where stripBoth (txt1, txt2) = (T.strip txt1, T.strip $ T.drop 1 txt2)
206 where stripBoth (txt1, txt2) = (T.strip txt1, T.strip $ T.drop 1 txt2)