URLsafe encoding needs to happen outside of btoa
This commit is contained in:
@ -52,11 +52,11 @@ export async function onRequestGet(context: RequestContext) {
|
|||||||
`https://mediaproxy.carcrushers.cc/${
|
`https://mediaproxy.carcrushers.cc/${
|
||||||
data.attachments[i]
|
data.attachments[i]
|
||||||
}?Expires=${exp}&KeyName=portal-media-linkgen&Signature=${btoa(
|
}?Expires=${exp}&KeyName=portal-media-linkgen&Signature=${btoa(
|
||||||
String.fromCharCode(...new Uint8Array(signatures[i]))
|
String.fromCharCode(...new Uint8Array(signatures[i])),
|
||||||
.replaceAll("+", "-")
|
)
|
||||||
.replaceAll("/", "_")
|
.replaceAll("+", "-")
|
||||||
.replaceAll("=", ""),
|
.replaceAll("/", "_")
|
||||||
)}`,
|
.replaceAll("=", "")}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user