Skip to content

Commit

Permalink
🐛 do not return error on handleStoreError, throw it!
Browse files Browse the repository at this point in the history
- ghost hangs if handleStoreError get's called
- we have to throw the error!
  • Loading branch information
kirrg001 committed Nov 10, 2016
1 parent c749fe2 commit cab4689
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/server/middleware/api/spam-prevention.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ var ExpressBrute = require('express-brute'),
logging = require('../../logging'),
spamConfigKeys = ['freeRetries', 'minWait', 'maxWait', 'lifetime'];

// weird, but true
handleStoreError = function handleStoreError(err) {
return new errors.NoPermissionError({message: 'DB error', err: err});
err.next(new errors.NoPermissionError({
message: 'Unknown error',
err: err.parent ? err.parent : err
}));
};

// This is a global endpoint protection mechanism that will lock an endpoint if there are so many
Expand Down

0 comments on commit cab4689

Please sign in to comment.