Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

put_object doesn't save metadata. save only 'x-amz-meta-KEY' keys #655

Closed
gzvulon opened this issue Apr 24, 2018 · 1 comment · Fixed by #656
Closed

put_object doesn't save metadata. save only 'x-amz-meta-KEY' keys #655

gzvulon opened this issue Apr 24, 2018 · 1 comment · Fixed by #656
Assignees
Milestone

Comments

@gzvulon
Copy link

gzvulon commented Apr 24, 2018

Description:
When I try to save dict to metadata with put_object,
it saves only keys which starts with 'x-amz-meta'
all other key are ignored, nested dicts are rising errors

Versions:
3.0.5 and 4.0.0

sample code to reproduce:

import minio
import io
client = minio.Minio('localhost:9000')
data_str="somestr"
oname='pp/gg.txt'
data = io.BytesIO(jpeg_str.encode())
client.put_object('uploads', oname, data, len(data_str), metadata= {
    'x-amz-meta-testing': 'values',
    'x-amz-meta-setting': 'zombies',
    'amz-meta-setting': 'zombiesddd',
    'hhh':34,
    'u_u': 'dd',
    'y-fu-bar': 'zoo'
})
stat = client.stat_object('uploads', oname)
print(stat.metadata)

Actual output:

{'X-Amz-Meta-Setting': 'zombies', 'X-Amz-Meta-Testing': 'values'}

Expected output:
same as original metadata dict

Is it by design?

@poornas
Copy link
Contributor

poornas commented Apr 25, 2018

@gzvulon, you are right - this is a bug. Will send in a fix shortly.

poornas added a commit to poornas/minio-py that referenced this issue Apr 25, 2018
…inio#655)

Change behavior to append x-amz-meta- prefix for user-defined metadata
if not already prefixed.
poornas added a commit to poornas/minio-py that referenced this issue Apr 25, 2018
…inio#655)

Change behavior to append x-amz-meta- prefix for user-defined metadata
if not already prefixed.
poornas added a commit to poornas/minio-py that referenced this issue Apr 25, 2018
…inio#655)

Change behavior to append x-amz-meta- prefix for user-defined metadata
if not already prefixed.
poornas added a commit to poornas/minio-py that referenced this issue Apr 25, 2018
…inio#655)

Prefix user-defined metadata with -x-amz-meta- if not already prefixed.
poornas added a commit to poornas/minio-py that referenced this issue Apr 25, 2018
…inio#655)

Prefix user-defined metadata with x-amz-meta- if not already prefixed.
poornas added a commit to poornas/minio-py that referenced this issue Apr 26, 2018
…inio#655)

Prefix user-defined metadata with x-amz-meta- if not already prefixed.
poornas added a commit to poornas/minio-py that referenced this issue Apr 26, 2018
…inio#655)

Prefix user-defined metadata with x-amz-meta- if not already prefixed.
poornas added a commit to poornas/minio-py that referenced this issue May 2, 2018
…inio#655)

Prefix user-defined metadata with x-amz-meta- if not already prefixed.
poornas added a commit to poornas/minio-py that referenced this issue May 2, 2018
…inio#655)

Prefix user-defined metadata with x-amz-meta- if not already prefixed.
deekoder pushed a commit that referenced this issue May 2, 2018
) (#656)

Prefix user-defined metadata with x-amz-meta- if not already prefixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants