Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
I am an idiot
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 5c238c5 commit f6251b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions/api/uploads/[[id]].ts
Expand Up @@ -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)),
Expand All @@ -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("/", "_")
Expand Down

0 comments on commit f6251b2

Please sign in to comment.