1111
This commit is contained in:
parent
d0b5151228
commit
8b72802dd4
6
index.js
6
index.js
@ -41,6 +41,10 @@ setInterval(() => {
|
|||||||
|
|
||||||
// 处理请求并返回数据
|
// 处理请求并返回数据
|
||||||
const server = http.createServer(async (req, res) => {
|
const server = http.createServer(async (req, res) => {
|
||||||
|
|
||||||
|
req.url = req.url.replace(/\/{2,}/g, '/');
|
||||||
|
|
||||||
|
|
||||||
if (req.url === '/favicon.ico') {
|
if (req.url === '/favicon.ico') {
|
||||||
res.writeHead(204);
|
res.writeHead(204);
|
||||||
res.end();
|
res.end();
|
||||||
@ -68,7 +72,7 @@ const server = http.createServer(async (req, res) => {
|
|||||||
|
|
||||||
if (!sign || reqPath === '/') {
|
if (!sign || reqPath === '/') {
|
||||||
res.writeHead(400, { 'Content-Type': 'text/plain' });
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user