Skip to content

Commit 8e1626b

Browse files
committed
fix: handle expire flag in object url regex
1 parent 83b4e1a commit 8e1626b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/public-terms-make.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@squarecloud/blob": patch
3+
---
4+
5+
Fix invalid object url error when expire flag is presented

src/utils/object-url.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SquareCloudBlobError } from "../structures/error";
22

33
const objectUrlRegex =
4-
/^(?<url>https:\/\/public-blob\.squarecloud\.dev)?\/?(?<userId>\d+\/)(?<prefix>[\w\d-_]+\/)?(?<name>[\w\d_]+)-(?<hash>[\w\d]+)\.(?<extension>\w+)$/;
4+
/^(?<url>https:\/\/public-blob\.squarecloud\.dev)?\/?(?<userId>\d+\/)(?<prefix>[\w\d\-_]+\/)?(?<name>[\w\d_]+)-(?<hash>[\w\d]+)(-ex\d+)?\.(?<extension>\w+)$/;
55

66
/**
77
* Parses the object URL to extract id, userId, prefix, name, hash and extension.

0 commit comments

Comments
 (0)