Maybe? fix signature handling
This commit is contained in:
parent
d8bf398ed4
commit
b97bfa9f26
@ -5,7 +5,7 @@ export async function onRequestGet(context: RequestContext) {
|
||||
).toString()}`;
|
||||
const signingKey = await crypto.subtle.importKey(
|
||||
"raw",
|
||||
new TextEncoder().encode(atob(context.env.URL_SIGNING_KEY)),
|
||||
Uint8Array.from(atob(context.env.URL_SIGNING_KEY), (c) => c.charCodeAt(0)),
|
||||
{ hash: "SHA-1", name: "HMAC" },
|
||||
false,
|
||||
["sign"],
|
||||
@ -17,7 +17,10 @@ export async function onRequestGet(context: RequestContext) {
|
||||
);
|
||||
|
||||
return Response.redirect(
|
||||
`${unsignedURL}&Signature=${btoa(new TextDecoder().decode(signature))
|
||||
`${unsignedURL}&Signature=${btoa(
|
||||
// @ts-expect-error
|
||||
String.fromCodePoint(...signature),
|
||||
)
|
||||
.replaceAll("+", "-")
|
||||
.replaceAll("/", "_")
|
||||
.replaceAll("=", "")}`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user