diff --git a/lib/FileAPI.XHR.js b/lib/FileAPI.XHR.js index ba4a158d..b4e109fc 100644 --- a/lib/FileAPI.XHR.js +++ b/lib/FileAPI.XHR.js @@ -46,7 +46,7 @@ } api.log('xhr.end:', status, statusText); - options.complete(status == 200 || status == 201 ? false : _this.statusText || 'unknown', _this); + options.complete(status < 300 && status >= 200 ? false : _this.statusText || 'unknown', _this); if( _this.xhr && _this.xhr.node ){ setTimeout(function (){ diff --git a/lib/FileAPI.core.js b/lib/FileAPI.core.js index ba825b70..71fe01f7 100644 --- a/lib/FileAPI.core.js +++ b/lib/FileAPI.core.js @@ -1154,7 +1154,7 @@ }); } else { - var successful = proxyXHR.status == 200 || proxyXHR.status == 201 || proxyXHR.status == 204; + var successful = proxyXHR.status < 300 && proxyXHR.status >= 200; options.complete(successful ? false : (proxyXHR.statusText || 'error'), proxyXHR, options); // Mark done state _complete = true; @@ -1396,7 +1396,7 @@ xhr.onreadystatechange = function(){ if( xhr.readyState == 4 ){ xhr.onreadystatechange = null; - if( xhr.status == 200 ){ + if( xhr.status < 300 && xhr.status >= 200 ){ url = url.split('/'); /** @namespace xhr.responseBody */ var file = {