Fire successCallback for any 2XX HTTP status

Found this bug when receiving a 201 response.
This commit is contained in:
Benjamin J DeLong
2017-07-07 21:11:23 -03:00
committed by GitHub
parent 9cf583ab39
commit a7d3c87650
+3 -1
View File
@@ -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;