fix(core): blob key issue for cloud blob provider (#4907)

There are some resources that only exists on `/static`. Current prefix check is incorrect since it could start with `/static`
This commit is contained in:
Peng Xiao 2023-11-20 13:53:25 +08:00 committed by 李华桥
parent 34c5e7d83d
commit add20ec2f8
No known key found for this signature in database

View File

@ -15,7 +15,9 @@ export const createCloudBlobStorage = (workspaceId: string): BlobStorage => {
return {
crud: {
get: async key => {
const suffix = predefinedStaticFiles.includes(key)
const suffix = key.startsWith('/')
? key
: predefinedStaticFiles.includes(key)
? `/static/${key}`
: `/api/workspaces/${workspaceId}/blobs/${key}`;