summaryrefslogtreecommitdiff
path: root/app/lib/static.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib/static.js')
-rw-r--r--app/lib/static.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/lib/static.js b/app/lib/static.js
index 26fc231..08c877f 100644
--- a/app/lib/static.js
+++ b/app/lib/static.js
@@ -1,5 +1,5 @@
import {normalize, extname} from "node:path";
-import {parse as parseURL} from "node:url";
+import {URL} from "node:url";
import fs from "node:fs";
const mimeTypes = {
@@ -46,7 +46,7 @@ export default class Static {
return;
}
- const pathname = parseURL(req.url).pathname;
+ const pathname = new URL(req.url, "file:").pathname; // TODO double-check
const sane = normalize(pathname).replace(/^(\.\.\/)+/, "");
let path = `${this.root}${sane}`; //Path.join(__dirname, sane);