mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-05 01:22:50 +00:00
replace . base64 character with ~ because discord things a . in the end is not part of the url
[deploy]
This commit is contained in:
@@ -11,7 +11,7 @@ export async function toBase64(blob: Blob): Promise<string> {
|
||||
resolve(
|
||||
(reader.result as string)
|
||||
.replace(/^data:application\/octet-stream;base64,/, "")
|
||||
.replaceAll("+", ".")
|
||||
.replaceAll("+", "~")
|
||||
.replaceAll("/", "_")
|
||||
.replaceAll("=", "-"),
|
||||
)
|
||||
@@ -23,7 +23,7 @@ export async function toBase64(blob: Blob): Promise<string> {
|
||||
export async function fromBase64(base64: string): Promise<Blob> {
|
||||
return fetch(
|
||||
`data:application/octet-stream;base64,${base64
|
||||
.replaceAll(".", "+")
|
||||
.replaceAll("~", "+")
|
||||
.replaceAll("_", "/")
|
||||
.replaceAll("-", "=")}`,
|
||||
).then(it => it.blob())
|
||||
|
||||
Reference in New Issue
Block a user