Refactor vless (#86)

fix issue #76
This commit is contained in:
zizifn
2023-01-06 01:11:39 +08:00
committed by GitHub
parent 8dc205dc8e
commit 8614399a5a
10 changed files with 317 additions and 197 deletions

View File

@@ -42,13 +42,18 @@ function authentication(context: EventContext<any, any, any>) {
},
});
} else {
return new Response(``, {
status: 302,
headers: {
'content-type': 'text/html; charset=utf-8',
Location: `./${userID}`,
},
});
const url = new URL(context.request.url);
if (url.pathname === '/') {
return new Response(``, {
status: 302,
headers: {
'content-type': 'text/html; charset=utf-8',
Location: `./${userID}`,
},
});
} else {
return context.next();
}
}
}