From 8b72802dd48308786032f6a418d63aad1a4a27ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=8B=E5=B0=8F=E9=99=8C?= Date: Sun, 13 Oct 2024 15:23:45 +0800 Subject: [PATCH] 1111 --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 7769b2d..9f85757 100644 --- a/index.js +++ b/index.js @@ -41,6 +41,10 @@ setInterval(() => { // 处理请求并返回数据 const server = http.createServer(async (req, res) => { + + req.url = req.url.replace(/\/{2,}/g, '/'); + + if (req.url === '/favicon.ico') { res.writeHead(204); res.end(); @@ -68,7 +72,7 @@ const server = http.createServer(async (req, res) => { if (!sign || reqPath === '/') { res.writeHead(400, { 'Content-Type': 'text/plain' }); - res.end('Bad Request: Missing sign or path'); + res.end('Bad Request: Missing sign or path (' + req.url + ')'); return; }