From a7d3c876506a0d694294c97e16d9e6b10b160c7a Mon Sep 17 00:00:00 2001 From: Benjamin J DeLong Date: Fri, 7 Jul 2017 21:11:23 -0300 Subject: [PATCH] Fire successCallback for any 2XX HTTP status Found this bug when receiving a 201 response. --- www/browser/FileTransfer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/browser/FileTransfer.js b/www/browser/FileTransfer.js index 14868ac..1cc6638 100644 --- a/www/browser/FileTransfer.js +++ b/www/browser/FileTransfer.js @@ -161,7 +161,9 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro } xhr.onload = function() { - if (this.status === 200) { + // 2xx codes are valid + if (this.status >= 200 && + this.status < 300) { var result = new FileUploadResult(); // jshint ignore:line result.bytesSent = blob.size; result.responseCode = this.status;