返回提交历史
Modified
src/controllers/custom/getGuildController.ts
+3
-3
XFEstudio/SpaceNinjaServer
chore: improve invalid request handling in /custom/getGuild (#3093)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3093 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
c033ec38
代码差异
1 个文件
+3
-3
@@ -6,7 +6,7 @@ import type { IGuildMemberClient } from "../../types/guildTypes.ts";
6
6
7
7
export const getGuildController: RequestHandler = async (req, res) => {
8
8
const guildId = req.query.guildId;
9
if (guildId) {
9
if (guildId && guildId.length == 24) {
10
10
const guild = await Guild.findById(guildId);
11
11
if (guild) {
12
12
const guildMembers = await GuildMember.find({ guildId: guild._id });
@@ -33,8 +33,8 @@ export const getGuildController: RequestHandler = async (req, res) => {
33
33
...guild.toObject(),
34
34
Members: members
35
35
});
36
} else {
37
res.status(400).end();
36
return;
38
37
}
39
38
}
39
res.status(400).end();
40
40
};