New formatting

This commit is contained in:
2023-10-19 16:50:21 -04:00
parent 0b5e82bfcc
commit 026d1ca06d
30 changed files with 76 additions and 76 deletions

View File

@ -8,18 +8,18 @@ export async function onRequestGet(context: RequestContext) {
new TextEncoder().encode(atob(context.env.URL_SIGNING_KEY)),
{ hash: "SHA-1", name: "HMAC" },
false,
["sign"]
["sign"],
);
const signature = await crypto.subtle.sign(
"HMAC",
signingKey,
new TextEncoder().encode(unsignedURL)
new TextEncoder().encode(unsignedURL),
);
return Response.redirect(
`${unsignedURL}&Signature=${btoa(new TextDecoder().decode(signature))
.replaceAll("+", "-")
.replaceAll("/", "_")
.replaceAll("=", "")}`
.replaceAll("=", "")}`,
);
}