Skip to content

Commit 6730ab1

Browse files
committed
Replace global json replacer with explicit JSON.stringify
1 parent 16c45d4 commit 6730ab1

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/server/Worker.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export async function startWorker() {
7878
});
7979

8080
app.set("trust proxy", 3);
81-
app.set("json replacer", replacer); // BigInt serialization
8281
app.use(express.json());
8382
app.use(express.static(path.join(__dirname, "../../out")));
8483
app.use(
@@ -254,11 +253,19 @@ export async function startWorker() {
254253
});
255254
}
256255

257-
return res.status(200).json({
258-
exists: true,
259-
gameRecord: gameRecord,
260-
success: true,
261-
});
256+
return res
257+
.status(200)
258+
.header("Content-Type", "application/json")
259+
.send(
260+
JSON.stringify(
261+
{
262+
exists: true,
263+
gameRecord: gameRecord,
264+
success: true,
265+
},
266+
replacer,
267+
),
268+
);
262269
}),
263270
);
264271

0 commit comments

Comments
 (0)