fix: fix no end '/' and set redirect

This commit is contained in:
xion 2024-10-07 23:26:44 +08:00
parent 75baf5a2a0
commit ace4d2d620

View File

@ -76,6 +76,11 @@ export const handleRequest = async (req: http.IncomingMessage, res: http.ServerR
return res.end();
}
const [_, _user, _app] = urls;
if (_app && urls.length === 3) {
// 重定向到
res.writeHead(302, { Location: `${url}/` });
return res.end();
}
if (!_user || !_app) {
res.write('Invalid URL\n');
return res.end();