XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

chore: gracefully handle credits request without credentials (#3869)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3869 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

71ed719c
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +6 -0
Modified src/controllers/api/creditsController.ts +6 -0
@@ -3,6 +3,12 @@ import { getAccountIdForRequest } from "../../services/loginService.ts";
3 3 import { getInventory } from "../../services/inventoryService.ts";
4 4
5 5 export const creditsController: RequestHandler = async (req, res) => {
6 // U9 and below are known to sometimes send this request without credentials, so just handle it more gracefully.
7 if (!req.query.accountId) {
8 res.sendStatus(400);
9 return;
10 }
11
6 12 const inventory = (
7 13 await Promise.all([
8 14 getAccountIdForRequest(req),