set content type for join errors (#207)

This commit is contained in:
Alec
2025-02-07 13:53:30 -05:00
committed by GitHub
parent 4b4b005d8a
commit 2a4fa2861f

View File

@@ -83,9 +83,11 @@ router.patch('/:code/players', async function (req, res) {
res.status(200).send({ cookie: data, environment: gameManager.environment });
}).catch((data) => {
console.error(data);
res.set('content-type', 'text/plain');
res.status(data.status || 500).send(data.reason);
});
} else {
res.set('content-type', 'text/plain');
res.status(404).send();
}
}