Skip to content

Commit f51ad72

Browse files
committed
Fix Respondable Foreign for IE
1 parent 4765623 commit f51ad72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Network/HTTP/Affjax/Response.purs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ responseTypeToString :: forall a. (ResponseType a) -> String
4343
responseTypeToString ArrayBufferResponse = "arraybuffer"
4444
responseTypeToString BlobResponse = "blob"
4545
responseTypeToString DocumentResponse = "document"
46-
responseTypeToString JSONResponse = "json"
46+
responseTypeToString JSONResponse = "text" -- IE doesn't support "json" responseType
4747
responseTypeToString StringResponse = "text"
4848

4949
-- | Type representing content types that be received from an XHR request
@@ -64,7 +64,7 @@ instance responsableDocument :: Respondable Document where
6464

6565
instance responsableJSON :: Respondable Foreign where
6666
responseType = JSONResponse
67-
fromResponse = Right
67+
fromResponse = readString >=> parseJSON
6868

6969
instance responsableString :: Respondable String where
7070
responseType = StringResponse

0 commit comments

Comments
 (0)