Skip to content

Commit

Permalink
fix: multipartUpload small file upload by callback data (#358)
Browse files Browse the repository at this point in the history
* fix(multipartUpload): #319 issues

* fix: check data
  • Loading branch information
binghaiwang authored and PeterRao committed Jan 24, 2018
1 parent b7c5daa commit b62bd2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/browser/multipart.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ proto.multipartUpload = function* multipartUpload(name, file, options) {
name: name,
etag: result.res.headers.etag
};

if (options.headers && options.headers['x-oss-callback']) {
ret.data = JSON.parse(result.data.toString());
ret.data = result.data;
}

return ret;
}

Expand Down
4 changes: 3 additions & 1 deletion lib/multipart.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ proto.multipartUpload = function* multipartUpload(name, file, options) {
name: name,
etag: result.res.headers.etag
};

if (options.headers && options.headers['x-oss-callback']) {
ret.data = JSON.parse(result.data.toString());
ret.data = result.data;
}

return ret;
}

Expand Down

0 comments on commit b62bd2e

Please sign in to comment.