From f6251b29184c6e6f12dcd29768fbd064cb291470 Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:50:42 -0400 Subject: [PATCH] I am an idiot --- functions/api/uploads/[[id]].ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/api/uploads/[[id]].ts b/functions/api/uploads/[[id]].ts index 18c3b62..4e36054 100644 --- a/functions/api/uploads/[[id]].ts +++ b/functions/api/uploads/[[id]].ts @@ -2,7 +2,7 @@ export async function onRequestGet(context: RequestContext) { const attachment = (context.params.id as string[]).join("/"); const unsignedURL = `https://mediaproxy.carcrushers.cc/${attachment}?Expires=${( Math.round(Date.now() / 1000) + 1800 - ).toString()}`; + ).toString()}&KeyName=portal-media-linkgen`; const signingKey = await crypto.subtle.importKey( "raw", Uint8Array.from(atob(context.env.URL_SIGNING_KEY), (c) => c.charCodeAt(0)), @@ -18,7 +18,7 @@ export async function onRequestGet(context: RequestContext) { return Response.redirect( `${unsignedURL}&Signature=${btoa( - String.fromCodePoint(...new Uint8Array(signature)), + String.fromCharCode(...new Uint8Array(signature)), ) .replaceAll("+", "-") .replaceAll("/", "_")