This commit is contained in:
naskya 2023-07-13 13:22:50 +00:00
parent 64322721b6
commit f451e97505

View File

@ -18,7 +18,7 @@ function getUserToken(ctx: Koa.BaseContext): string | null {
function compareOrigin(ctx: Koa.BaseContext): boolean {
function normalizeUrl(url?: string): string {
return slice( url.length - 1) : url) : "";
return url ? (url.endsWith("/") ? url.slice(0, url.length - 1) : url) : "";
}
const referer = ctx.headers["referer"];