scality / cloudserver

Zenko CloudServer, an open-source Node.js implementation of the Amazon S3 protocol on the front-end and backend storage capabilities to multiple clouds, including Azure and Google.

Home Page:https://www.zenko.io/cloudserver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Metadata in presigned links not working

mrpotato3 opened this issue · comments

Bug report information

When I create a signed link with metadata it generates the link correctly but does not insert the metadata when upload file.

Steps to reproduce the issue

Direct file upload code (working as expected):

const command = new PutObjectCommand({
  Bucket: 'bucket',
  Key: 'test',
  Body: 'Test content...',
  Metadata: {
    a: 'a',
    b: 'b',
    c: 'c'
  },
})
const r3 = await storage.send(command)

Presigned link with metadata generation:

const command = new PutObjectCommand({
  Bucket: 'bucket',
  Key: 'test',
  Metadata:  {
    a: 'a',
    b: 'b',
    c: 'c'
  },
})
const uploadLink = await getSignedUrl(storage, command, { expiresIn: 300 })

Output link (correct):

https://host.tld/bucket/test?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=12345%2F20220219%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220219T101832Z&X-Amz-Expires=300&X-Amz-Signature=24ee6287286fc65b462043e671d9f4c298caf0a6e70bab3eccfddd1dfcba760d&X-Amz-SignedHeaders=host&x-amz-meta-a=a&x-amz-meta-b=b&x-amz-meta-c=c&x-id=PutObject

Actual result (no metadata)

image

Expected result

image

Thank you!!!