Skip to content

Commit

Permalink
🐛 Fix: fix an issue where files uploaded to minio using s3 plugin can…
Browse files Browse the repository at this point in the history
…'t be deleted remotely
  • Loading branch information
Kuingsmile committed Aug 29, 2023
1 parent 0c8ea83 commit 80db40b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/utils/deleteFunc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ export async function removeFileFromS3InMain (configMap: IStringKeyMap, dogeMode
try {
const { imgUrl, config: { accessKeyID, secretAccessKey, bucketName, region, endpoint, pathStyleAccess, rejectUnauthorized, proxy } } = configMap
const url = new URL(!/^https?:\/\//.test(imgUrl) ? `http://${imgUrl}` : imgUrl)
const fileKey = url.pathname.replace(/^\/+/, '')
let fileKey = url.pathname.replace(/^\/+/, '')
if (pathStyleAccess) {
fileKey = fileKey.replace(/^[^/]+\//, '')
}
const endpointUrl: string | undefined = endpoint
? /^https?:\/\//.test(endpoint)
? endpoint
Expand Down

0 comments on commit 80db40b

Please sign in to comment.