adding proper support for the spaces_url param (#876)
This commit is contained in:
@@ -7,7 +7,7 @@ class DigitalOceanService extends FileService {
|
|||||||
super()
|
super()
|
||||||
|
|
||||||
this.bucket_ = options.bucket
|
this.bucket_ = options.bucket
|
||||||
this.spacesUrl_ = options.spaces_url
|
this.spacesUrl_ = options.spaces_url?.replace(/\/$/, "")
|
||||||
this.accessKeyId_ = options.access_key_id
|
this.accessKeyId_ = options.access_key_id
|
||||||
this.secretAccessKey_ = options.secret_access_key
|
this.secretAccessKey_ = options.secret_access_key
|
||||||
this.region_ = options.region
|
this.region_ = options.region
|
||||||
@@ -38,6 +38,10 @@ class DigitalOceanService extends FileService {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.spacesUrl_) {
|
||||||
|
resolve({ url: `${this.spacesUrl_}/${data.Key}` })
|
||||||
|
}
|
||||||
|
|
||||||
resolve({ url: data.Location })
|
resolve({ url: data.Location })
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user