fix(s3): Avoid invalid URL error on delete

This commit is contained in:
roschaefer 2020-03-22 17:01:02 +01:00 committed by mattwr18
parent e9bd969f0a
commit 79808fe692

View File

@ -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,