1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-01 16:28:33 +09:00

[API] Fix: Validate id

This commit is contained in:
syuilo 2017-01-21 07:33:46 +09:00
parent 4ad04f5bfa
commit 1c9ec60140

View File

@ -25,6 +25,11 @@ module.exports = (params, user) =>
return rej('post_id is required');
}
// Validate id
if (!mongo.ObjectID.isValid(postId)) {
return rej('incorrect post_id');
}
// Get likee
const post = await Post.findOne({
_id: new mongo.ObjectID(postId)