Spaces:
Running
Running
Commit
·
5ffd931
1
Parent(s):
67f97d0
fix fatal mistale in the base64 detector
Browse files
src/lib/utils/extractBase64.ts
CHANGED
@@ -14,7 +14,7 @@ export function extractBase64(base64: string = ""): {
|
|
14 |
blob: Blob;
|
15 |
} {
|
16 |
// Regular expression to extract the MIME type and the base64 data
|
17 |
-
const matches = base64.match(/^data:([A-Za-z
|
18 |
|
19 |
if (!matches || matches.length !== 3) {
|
20 |
throw new Error("Invalid base64 string")
|
|
|
14 |
blob: Blob;
|
15 |
} {
|
16 |
// Regular expression to extract the MIME type and the base64 data
|
17 |
+
const matches = base64.match(/^data:([A-Za-z-+0-9/]+);base64,(.+)$/)
|
18 |
|
19 |
if (!matches || matches.length !== 3) {
|
20 |
throw new Error("Invalid base64 string")
|