Skip to content

fix missing md5 #551

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

fix missing md5 #551

wants to merge 2 commits into from

Conversation

teacup418
Copy link

fix problem "An error occurred (MissingContentMD5) when calling the PutObjectRetention operation: Missing required header for this request: Content-Md5."

fix problem "An error occurred (MissingContentMD5) when calling the PutObjectRetention operation: Missing required header for this request: Content-Md5."
@teacup418
Copy link
Author

teacup418 commented Jun 20, 2025

Directly running it will result in an error. After gathering information, it was found that MD5 needs to be added.

图片

@teacup418
Copy link
Author

calculate by this code:

import hashlib
import base64

def get_content_md5(data):
    digest = hashlib.md5(data.encode('utf-8')).digest()
    return base64.b64encode(digest)

content_md5 = get_content_md5("{}")
content_md5_string = content_md5.decode('utf-8')

print(content_md5_string)

@teacup418
Copy link
Author

Well... it seems that the base64 of md5 doesn't have much impact regardless of what value it is. The first value was told to me by AI.

@AlexeyALeonov
Copy link
Collaborator

This is likely related to this issue: storj/gateway-st#89

and documented there: https://storj.dev/dcs/api/s3/s3-compatibility#compatibility-with-python-sdk-and-cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants