mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
fix(s3): Avoid invalid URL error on delete
This commit is contained in:
parent
e9bd969f0a
commit
79808fe692
@ -142,7 +142,7 @@ const localFileDelete = async url => {
|
||||
|
||||
const s3Delete = async url => {
|
||||
const s3 = new S3({ region, endpoint })
|
||||
let { pathname } = new URL(url)
|
||||
let { pathname } = new URL(url, 'http://example.org') // dummy domain to avoid invalid URL error
|
||||
pathname = pathname.substring(1) // remove first character '/'
|
||||
const params = {
|
||||
Bucket,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user