Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Colyseus for Multiplayer #27

Merged
merged 67 commits into from
Mar 17, 2024
Merged

Integrate Colyseus for Multiplayer #27

merged 67 commits into from
Mar 17, 2024

Conversation

keshav2010
Copy link
Owner

No description provided.

Comment on lines 38 to 58
app.get("/", async (req, res) => {
try {
const pathName = path.resolve(__dirname, "dist");
const files = await fs.promises.readdir(pathName);
const filename = files.find((file) => path.extname(file) === ".html");
if (!filename) {
return res
.status(500)
.send(`<h1>ERROR! No HTML files found in ${pathName}</h1>`);
}
const filepath = path.resolve(pathName, filename);
const stats = await fs.promises.stat(filepath);
if (!stats.isFile()) {
return res.status(500).send(`<h1>ERROR! ${filename} is not a file.</h1>`);
}
res.sendFile(filepath);
} catch (err) {
console.error(err);
res.status(500).send("<h1>Internal Server Error, Try again later.</h1>");
}
});

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
a file system access
, but is not rate-limited.
This route handler performs
a file system access
, but is not rate-limited.
This route handler performs
a file system access
, but is not rate-limited.
@keshav2010 keshav2010 merged commit ef667d1 into main Mar 17, 2024
2 of 6 checks passed
@keshav2010 keshav2010 deleted the migrate-to-colyseus branch March 17, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant