feat: Prevent Parse Server start in case of unknown option in server configuration (#8987)
This commit is contained in:
@@ -64,6 +64,7 @@ export class Config {
|
||||
}
|
||||
|
||||
static validateOptions({
|
||||
customPages,
|
||||
publicServerURL,
|
||||
revokeSessionOnPasswordReset,
|
||||
expireInactiveSessions,
|
||||
@@ -133,9 +134,18 @@ export class Config {
|
||||
this.validateRateLimit(rateLimit);
|
||||
this.validateLogLevels(logLevels);
|
||||
this.validateDatabaseOptions(databaseOptions);
|
||||
this.validateCustomPages(customPages);
|
||||
this.validateAllowClientClassCreation(allowClientClassCreation);
|
||||
}
|
||||
|
||||
static validateCustomPages(customPages) {
|
||||
if (!customPages) return;
|
||||
|
||||
if (Object.prototype.toString.call(customPages) !== '[object Object]') {
|
||||
throw Error('Parse Server option customPages must be an object.');
|
||||
}
|
||||
}
|
||||
|
||||
static validateControllers({
|
||||
verifyUserEmails,
|
||||
userController,
|
||||
@@ -569,6 +579,7 @@ export class Config {
|
||||
if (Object.prototype.toString.call(databaseOptions) !== '[object Object]') {
|
||||
throw `databaseOptions must be an object`;
|
||||
}
|
||||
|
||||
if (databaseOptions.enableSchemaHooks === undefined) {
|
||||
databaseOptions.enableSchemaHooks = DatabaseOptions.enableSchemaHooks.default;
|
||||
} else if (typeof databaseOptions.enableSchemaHooks !== 'boolean') {
|
||||
|
||||
Reference in New Issue
Block a user