fix: bigint解析失败导致500

This commit is contained in:
linyuchen
2024-02-03 15:18:22 +08:00
parent 1554f1b08e
commit b3981f22f2

View File

@@ -149,7 +149,7 @@ export function startExpress(port: number) {
app.use(express.json({ app.use(express.json({
limit: '500mb', limit: '500mb',
verify: (req: any, res: any, buf: any, encoding: any) => { verify: (req: any, res: any, buf: any, encoding: any) => {
req.rawBody = buf req.rawBody = buf;
} }
})); }));
app.use((req: any, res: any, next: any) => { app.use((req: any, res: any, next: any) => {
@@ -157,7 +157,8 @@ export function startExpress(port: number) {
req.body = JSONbig.parse(req.rawBody.toString()); req.body = JSONbig.parse(req.rawBody.toString());
next(); next();
} catch (error) { } catch (error) {
next(error); // next(error);
next();
} }
}); });