revert: removal of `Meteor.bindEnvironment` on `DDPRateLimiter.addRule` (#28874)

pull/28874/merge
Diego Sampaio 3 years ago committed by GitHub
parent a9cdc9cb49
commit 09fa78bd9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      apps/meteor/app/lib/server/startup/rateLimiter.js

@ -30,12 +30,12 @@ const names = new Set(
// Override the addRule to save new names added after this point
const { addRule } = DDPRateLimiter;
DDPRateLimiter.addRule = (matcher, calls, time, callback) => {
DDPRateLimiter.addRule = Meteor.bindEnvironment((matcher, calls, time, callback) => {
if (matcher && typeof matcher.name === 'string') {
names.add(matcher.name);
}
return addRule.call(DDPRateLimiter, matcher, calls, time, callback);
};
});
const { _increment } = DDPRateLimiter;
DDPRateLimiter._increment = function (input) {

Loading…
Cancel
Save