Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove file extension goofiness
  • Loading branch information
regalijan committed Mar 26, 2024
1 parent 0cddcbf commit 65b33e4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions functions/api/reports/submit.ts
Expand Up @@ -165,7 +165,7 @@ export async function onRequestPost(context: RequestContext) {
context.env,
["mp4", "m4v", "webm"].includes(fileExten)
? fileUploadKey
: `t/${fileUploadKey}.${fileExten}`,
: `t/${fileUploadKey}`,
file.size,
fileExten,
),
Expand Down Expand Up @@ -208,11 +208,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?\//, "")
.replace(/\.\w*$/, ""),
);
attachments.push(new URL(urlResult.value).pathname.replace(/^\/?t?\//, ""));
}

await context.env.DATA.put(
Expand Down

0 comments on commit 65b33e4

Please sign in to comment.