New formatting
This commit is contained in:
@ -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("=", "")}`,
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user