File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import Affjax.RequestHeader as RequestHeader
2020import Affjax.ResponseFormat as ResponseFormat
2121import Affjax.ResponseHeader (ResponseHeader (..))
2222import Affjax.StatusCode (StatusCode )
23+ import Control.Alt ((<|>))
2324import Control.Monad.Except (runExcept )
2425import Data.Argonaut.Core (Json )
2526import Data.Argonaut.Core as J
@@ -256,7 +257,9 @@ request req =
256257 fromResponse = case req.responseFormat of
257258 ResponseFormat.ArrayBuffer _ -> unsafeReadTagged " ArrayBuffer"
258259 ResponseFormat.Blob _ -> unsafeReadTagged " Blob"
259- ResponseFormat.Document _ -> unsafeReadTagged " Document"
260+ ResponseFormat.Document _ -> \x → unsafeReadTagged " Document" x
261+ <|> unsafeReadTagged " XMLDocument" x
262+ <|> unsafeReadTagged " HTMLDocument" x
260263 ResponseFormat.Json coe -> coe <<< parseJSON <=< unsafeReadTagged " String"
261264 ResponseFormat.String _ -> unsafeReadTagged " String"
262265 ResponseFormat.Ignore coe -> const $ coe (pure unit)
You can’t perform that action at this time.
0 commit comments