mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-25 00:49:17 +09:00
[API] Fix: Validate file_id
This commit is contained in:
parent
27c4d4b83b
commit
40f05f4ea5
@ -26,6 +26,11 @@ module.exports = (params, user) =>
|
|||||||
return rej('file_id is required');
|
return rej('file_id is required');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate id
|
||||||
|
if (!mongo.ObjectID.isValid(fileId)) {
|
||||||
|
return rej('incorrect file_id');
|
||||||
|
}
|
||||||
|
|
||||||
const file = await DriveFile
|
const file = await DriveFile
|
||||||
.findOne({
|
.findOne({
|
||||||
_id: new mongo.ObjectID(fileId),
|
_id: new mongo.ObjectID(fileId),
|
||||||
|
Loading…
Reference in New Issue
Block a user