adding proper support for the spaces_url param (#876)

This commit is contained in:
Joey Eamigh
2021-12-03 09:44:57 +01:00
committed by GitHub
parent 0523d9478f
commit 64b93b5953
@@ -7,7 +7,7 @@ class DigitalOceanService extends FileService {
super()
this.bucket_ = options.bucket
this.spacesUrl_ = options.spaces_url
this.spacesUrl_ = options.spaces_url?.replace(/\/$/, "")
this.accessKeyId_ = options.access_key_id
this.secretAccessKey_ = options.secret_access_key
this.region_ = options.region
@@ -38,6 +38,10 @@ class DigitalOceanService extends FileService {
return
}
if (this.spacesUrl_) {
resolve({ url: `${this.spacesUrl_}/${data.Key}` })
}
resolve({ url: data.Location })
})
})