From 3759fe46e9158e27d40e113adf12b75642e44ec5 Mon Sep 17 00:00:00 2001 From: lilia Date: Wed, 25 Mar 2015 11:45:42 -0700 Subject: [PATCH] Account for -1 HTTPError code --- js/libtextsecure.js | 2 +- libtextsecure/api.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 15878708..af198dd3 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -39066,7 +39066,7 @@ window.textsecure.api = function () { if (options.dataType === 'json') { try { result = JSON.parse(xhr.responseText + ''); } catch(e) {} } - if (xhr.status < 400) { + if ( 0 <= xhr.status && xhr.status < 400) { options.success(result, xhr.status); } else { options.error(result, xhr.status); diff --git a/libtextsecure/api.js b/libtextsecure/api.js index 4cf1f11b..91dfcc01 100644 --- a/libtextsecure/api.js +++ b/libtextsecure/api.js @@ -77,7 +77,7 @@ window.textsecure.api = function () { if (options.dataType === 'json') { try { result = JSON.parse(xhr.responseText + ''); } catch(e) {} } - if (xhr.status < 400) { + if ( 0 <= xhr.status && xhr.status < 400) { options.success(result, xhr.status); } else { options.error(result, xhr.status);