From 0c1594687452c9f4f7a017a724ca8106d8716b89 Mon Sep 17 00:00:00 2001 From: Yanlong Wang Date: Thu, 30 May 2024 20:29:31 +0800 Subject: [PATCH] fix: trimstart url --- backend/functions/src/cloud-functions/crawler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/functions/src/cloud-functions/crawler.ts b/backend/functions/src/cloud-functions/crawler.ts index b991215..e121ec4 100644 --- a/backend/functions/src/cloud-functions/crawler.ts +++ b/backend/functions/src/cloud-functions/crawler.ts @@ -547,7 +547,7 @@ ${suffixMixins.length ? `\n${suffixMixins.join('\n\n')}\n` : ''}`; ) { const uid = await auth.solveUID(); let chargeAmount = 0; - const noSlashURL = ctx.req.url.slice(1); + const noSlashURL = ctx.req.url.slice(1).trimStart(); if (!noSlashURL) { const latestUser = uid ? await auth.assertUser() : undefined; if (!ctx.req.accepts('text/plain') && (ctx.req.accepts('text/json') || ctx.req.accepts('application/json'))) {