mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-15 06:27:34 -07:00
[API] Fix: Validate file_id
This commit is contained in:
parent
330a57977e
commit
ba14a1cb4a
1 changed files with 5 additions and 0 deletions
|
@ -26,6 +26,11 @@ module.exports = (params, user) =>
|
|||
return rej('file_id is required');
|
||||
}
|
||||
|
||||
// Validate id
|
||||
if (!mongo.ObjectID.isValid(fileId)) {
|
||||
return rej('incorrect file_id');
|
||||
}
|
||||
|
||||
const file = await DriveFile
|
||||
.findOne({
|
||||
_id: new mongo.ObjectID(fileId),
|
||||
|
|
Loading…
Reference in a new issue