From 2ce2f5195de52a96c51636b2f78b11cc3832428d Mon Sep 17 00:00:00 2001 From: "Alexander J. Lallier" Date: Wed, 14 Aug 2024 10:57:56 -0400 Subject: [PATCH] Fix pathname --- lib/reload-server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/reload-server.js b/lib/reload-server.js index 5b69a31..362fef4 100644 --- a/lib/reload-server.js +++ b/lib/reload-server.js @@ -39,7 +39,7 @@ const tryFiles = (...files) => { const serve = serveStatic(dir, { index: ['index.html', 'index.htm'] }) const server = http.createServer(function (req, res) { - const pathname = new URL(req.url).pathname + const pathname = new URL(req.url, `http://${hostname}`).pathname const ext = path.extname(pathname) const file = path.join(dir, pathname)