Handle forward slash in attachments url change

This commit is contained in:
Regalijan 2024-03-25 23:07:39 -04:00
parent 2411714bce
commit 80be02d6a4
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -203,7 +203,7 @@ export async function onRequestPost(context: RequestContext) {
for (const urlResult of uploadUrlResults as PromiseFulfilledResult<string>[]) {
uploadUrls.push(urlResult.value);
attachments.push(new URL(urlResult.value).pathname.replace(/^t\//, ""));
attachments.push(new URL(urlResult.value).pathname.replace(/^\/?t\//, ""));
}
await context.env.DATA.put(