Skip to content

Commit

Permalink
fix: returns 403 (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
d2lam authored and Pranav Ravichandran committed Nov 21, 2018
1 parent 682f7e4 commit 355cc3c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions plugins/caches.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,21 +389,21 @@ exports.plugin = {
}

return new Promise((resolve, reject) => req(opts, (err, response) => {
if (err) {
return reject(err);
if (!err && response.body === true) {
return awsClient.invalidateCache(cachePath, (e) => {
if (e) {
return reject(e);
}

return resolve();
});
}

if (response.body === false) {
if (!err && response.body === false) {
return reject('Permission denied');
}

return awsClient.invalidateCache(cachePath, (e) => {
if (e) {
return reject(e);
}

return resolve();
});
return reject(err);
})).then(() => h.response().code(200))
.catch((err) => {
if (err === 'Permission denied') {
Expand Down

0 comments on commit 355cc3c

Please sign in to comment.