diff --git a/lib/load-config.js b/lib/load-config.js index 0b861b826..4d6fa894f 100644 --- a/lib/load-config.js +++ b/lib/load-config.js @@ -36,5 +36,11 @@ if (!isPositiveNumber(config.defaultStorageLimit)) { config.defaultStorageLimit = 50 * 1024 * 1024; } +// premiumUploadSize is worthless if it isn't a valid positive number +// or if it's less than the default upload size +if (!isPositiveNumber(config.premiumUploadSize) || config.premiumUploadSize < config.defaultStorageLimit) { + delete config.premiumUploadSize; +} + module.exports = config; diff --git a/server.js b/server.js index d7f663d4e..7b0e93687 100644 --- a/server.js +++ b/server.js @@ -225,7 +225,9 @@ var serveConfig = (function () { adminEmail: config.adminEmail, adminKeys: admins, inactiveTime: config.inactiveTime, - supportMailbox: config.supportMailboxPublicKey + supportMailbox: config.supportMailboxPublicKey, + maxUploadSize: config.maxUploadSize, + premiumUploadSize: config.premiumUploadSize, }, null, '\t'), 'obj.httpSafeOrigin = ' + (function () { if (config.httpSafeOrigin) { return '"' + config.httpSafeOrigin + '"'; }