satisfy typescript for github actions

This commit is contained in:
stjet
2026-04-12 07:02:36 +00:00
parent 641c57377e
commit 4cde2c88aa
3 changed files with 13 additions and 9 deletions

View File

@@ -6,13 +6,14 @@ const port: number = 8042;
createServer((req, res) => {
let req_path: string;
if (!req.url.includes(".")) {
req_path = path.join(__dirname, "build", req.url, "index.html");
let req_url = req.url ?? ""; //fucking typescript shit. there will be a url trust me
if (!req_url.includes(".")) {
req_path = path.join(__dirname, "build", req_url, "index.html");
} else {
req_path = path.join(__dirname, "build", req.url);
req_path = path.join(__dirname, "build", req_url);
}
let status_code = 200;
//req.url.includes("..")
//req_url.includes("..")
if (!req_path.startsWith(path.join(__dirname, "build"))) {
//nice try, bad request
res.writeHead(400);