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; }