fix: fix no end '/' and set redirect
This commit is contained in:
parent
75baf5a2a0
commit
ace4d2d620
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user