Skip to content

Commit

Permalink
fix(request.signer.js): Client-side signing errors don't reject promi…
Browse files Browse the repository at this point in the history
…se (FineUploader#1666)

This is yet another instance that details why I would like to rip out `qq.Promise` and instead depend on native `Promise` (or require a polyfill).
  • Loading branch information
fromkeith authored and rnicholus committed Sep 29, 2016
1 parent f870931 commit 2b7fa0b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions client/js/s3/request-signer.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ qq.s3.RequestSigner = function(o) {
requestInfo.hashedContent = hashedContent;

promise.success(generateStringToSign(requestInfo));
}, function (err) {
promise.failure(err);
});
}
else {
Expand All @@ -424,6 +426,8 @@ qq.s3.RequestSigner = function(o) {

toBeSigned.signatureConstructor.getToSign(id).then(function(signatureArtifacts) {
signApiRequest(toBeSigned.signatureConstructor, signatureArtifacts.stringToSign, signatureEffort);
}, function (err) {
signatureEffort.failure(err);
});
}
// Form upload (w/ policy document)
Expand Down Expand Up @@ -514,6 +518,9 @@ qq.s3.RequestSigner = function(o) {
.withParams(params)
.withQueryParams(queryParams)
.send();
}, function (err) {
options.log("Failed to construct signature. ", "error");
signatureEffort.failure("Failed to construct signature.");
});
}
else {
Expand Down Expand Up @@ -600,6 +607,8 @@ qq.s3.RequestSigner = function(o) {
stringToSign: artifacts.toSign,
stringToSignRaw: artifacts.toSignRaw
});
}, function (err) {
promise.failure(err);
});

return promise;
Expand Down

0 comments on commit 2b7fa0b

Please sign in to comment.