fix: Server internal error details leaking in error messages returned to clients (#9937)
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import PromiseRouter from '../PromiseRouter';
|
||||
import * as middleware from '../middlewares';
|
||||
import Parse from 'parse/node';
|
||||
import { createSanitizedError } from '../Error';
|
||||
|
||||
export class PurgeRouter extends PromiseRouter {
|
||||
handlePurge(req) {
|
||||
if (req.auth.isReadOnly) {
|
||||
throw new Parse.Error(
|
||||
throw createSanitizedError(
|
||||
Parse.Error.OPERATION_FORBIDDEN,
|
||||
"read-only masterKey isn't allowed to purge a schema."
|
||||
"read-only masterKey isn't allowed to purge a schema.",
|
||||
);
|
||||
}
|
||||
return req.config.database
|
||||
|
||||
Reference in New Issue
Block a user