git.iko.soy/typeable/servant
on master help sign in
Add 205
82fa235Arian van Putten
servant-js/src/Servant/JS/Vanilla.hs+1−1
@@ -37,7 +37,7 @@ generateVanillaJSWith opts req = "\n" <>
37 <> (if isJust (req ^. reqBody) then " xhr.setRequestHeader(\"Content-Type\",\"application/json\");\n" else "")
37 <> (if isJust (req ^. reqBody) then " xhr.setRequestHeader(\"Content-Type\",\"application/json\");\n" else "")
38 <> " xhr.onreadystatechange = function (e) {\n"
38 <> " xhr.onreadystatechange = function (e) {\n"
39 <> " if (xhr.readyState == 4) {\n"
39 <> " if (xhr.readyState == 4) {\n"
40− <> " if (xhr.status == 204) {\n"
40+ <> " if (xhr.status == 204 || xhr.status == 205) {\n"
41 <> " onSuccess();\n"
41 <> " onSuccess();\n"
42 <> " } else if (xhr.status >= 200 && xhr.status < 300) {\n"
42 <> " } else if (xhr.status >= 200 && xhr.status < 300) {\n"
43 <> " var value = JSON.parse(xhr.responseText);\n"
43 <> " var value = JSON.parse(xhr.responseText);\n"