mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-23 10:18:40 +00:00
add getBucket metadata argument (#4770)
* add metadata to getBucket * change getBucket call
This commit is contained in:
parent
0854f12392
commit
724bd7b3ed
2 changed files with 3 additions and 3 deletions
|
|
@ -655,7 +655,7 @@ class Uploader {
|
|||
const { client, options } = s3Options
|
||||
|
||||
const params = {
|
||||
Bucket: getBucket(options.bucket),
|
||||
Bucket: getBucket(options.bucket, null, this.options.metadata),
|
||||
Key: options.getKey(null, filename, this.options.metadata),
|
||||
ContentType: this.options.metadata.type,
|
||||
Metadata: rfc2047EncodeMetadata(this.options.metadata),
|
||||
|
|
|
|||
|
|
@ -187,8 +187,8 @@ module.exports.rfc2047EncodeMetadata = (metadata) => (
|
|||
Object.fromEntries(Object.entries(metadata).map((entry) => entry.map(rfc2047Encode)))
|
||||
)
|
||||
|
||||
module.exports.getBucket = (bucketOrFn, req) => {
|
||||
const bucket = typeof bucketOrFn === 'function' ? bucketOrFn(req) : bucketOrFn
|
||||
module.exports.getBucket = (bucketOrFn, req, metadata) => {
|
||||
const bucket = typeof bucketOrFn === 'function' ? bucketOrFn(req, metadata) : bucketOrFn
|
||||
|
||||
if (typeof bucket !== 'string' || bucket === '') {
|
||||
// This means a misconfiguration or bug
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue