mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-03-15 17:28:13 -04:00
🐛 Fix: fix an issue where files uploaded to minio using s3 plugin can't be deleted remotely
This commit is contained in:
parent
0c8ea832aa
commit
80db40b0f0
@ -75,7 +75,10 @@ export async function removeFileFromS3InMain (configMap: IStringKeyMap, dogeMode
|
|||||||
try {
|
try {
|
||||||
const { imgUrl, config: { accessKeyID, secretAccessKey, bucketName, region, endpoint, pathStyleAccess, rejectUnauthorized, proxy } } = configMap
|
const { imgUrl, config: { accessKeyID, secretAccessKey, bucketName, region, endpoint, pathStyleAccess, rejectUnauthorized, proxy } } = configMap
|
||||||
const url = new URL(!/^https?:\/\//.test(imgUrl) ? `http://${imgUrl}` : imgUrl)
|
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
|
const endpointUrl: string | undefined = endpoint
|
||||||
? /^https?:\/\//.test(endpoint)
|
? /^https?:\/\//.test(endpoint)
|
||||||
? endpoint
|
? endpoint
|
||||||
|
Loading…
Reference in New Issue
Block a user