|
|
@ -37,6 +37,16 @@ Quota.applyCustomLimits = function (Env) {
|
|
|
|
var limits = {};
|
|
|
|
var limits = {};
|
|
|
|
Object.keys(custom).forEach(function (k) {
|
|
|
|
Object.keys(custom).forEach(function (k) {
|
|
|
|
var user;
|
|
|
|
var user;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// XXX this length (44) is also hardcoded in decrees.js
|
|
|
|
|
|
|
|
// before calling Keys.parseUser.
|
|
|
|
|
|
|
|
// Maybe we should improve Keys.parseUser to handle this
|
|
|
|
|
|
|
|
// option directly
|
|
|
|
|
|
|
|
if (k.length === 44) {
|
|
|
|
|
|
|
|
user = {
|
|
|
|
|
|
|
|
pubkey: Util.unescapeKeyCharacters(k)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
user = Keys.parseUser(k);
|
|
|
|
user = Keys.parseUser(k);
|
|
|
|
} catch (err) {
|
|
|
|
} catch (err) {
|
|
|
@ -45,6 +55,7 @@ Quota.applyCustomLimits = function (Env) {
|
|
|
|
error: err.message,
|
|
|
|
error: err.message,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var unsafeKey = user.pubkey;
|
|
|
|
var unsafeKey = user.pubkey;
|
|
|
|
limits[unsafeKey] = custom[k];
|
|
|
|
limits[unsafeKey] = custom[k];
|
|
|
|