From b67839a4c59c71b8d75021861335aa4eb9bf0267 Mon Sep 17 00:00:00 2001 From: Gary Burgess Date: Sun, 27 May 2018 17:26:13 +0100 Subject: [PATCH] Add statusText to response --- src/Network/HTTP/Affjax.js | 2 +- src/Network/HTTP/Affjax.purs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Network/HTTP/Affjax.js b/src/Network/HTTP/Affjax.js index b4c5533..034aba2 100644 --- a/src/Network/HTTP/Affjax.js +++ b/src/Network/HTTP/Affjax.js @@ -59,6 +59,7 @@ exports._ajax = function () { xhr.onload = function () { callback({ status: xhr.status, + statusText: xhr.statusText, headers: xhr.getAllResponseHeaders().split("\r\n") .filter(function (header) { return header.length > 0; @@ -85,4 +86,3 @@ exports._ajax = function () { }; }; }(); - diff --git a/src/Network/HTTP/Affjax.purs b/src/Network/HTTP/Affjax.purs index 59451fd..36f47ad 100644 --- a/src/Network/HTTP/Affjax.purs +++ b/src/Network/HTTP/Affjax.purs @@ -75,6 +75,7 @@ defaultRequest = -- | The type of records that will be received as an Affjax response. type AffjaxResponse a = { status :: StatusCode + , statusText :: String , headers :: Array ResponseHeader , response :: a }