URLsafe encoding needs to happen outside of btoa

This commit is contained in:
Regalijan
2023-10-23 20:20:44 -04:00
parent d87d801475
commit 4559349ac6

View File

@ -52,11 +52,11 @@ export async function onRequestGet(context: RequestContext) {
`https://mediaproxy.carcrushers.cc/${
data.attachments[i]
}?Expires=${exp}&KeyName=portal-media-linkgen&Signature=${btoa(
String.fromCharCode(...new Uint8Array(signatures[i]))
String.fromCharCode(...new Uint8Array(signatures[i])),
)
.replaceAll("+", "-")
.replaceAll("/", "_")
.replaceAll("=", ""),
)}`,
.replaceAll("=", "")}`,
);
}