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

Metadata values starting with space leading to signature mismatch on PUT #1434

Closed
sidharthrajaram opened this issue Aug 16, 2024 · 1 comment · Fixed by #1435
Closed

Metadata values starting with space leading to signature mismatch on PUT #1434

sidharthrajaram opened this issue Aug 16, 2024 · 1 comment · Fixed by #1435

Comments

@sidharthrajaram
Copy link

When the following is done:

minio_client.fput_object(
    MY_BUCKET,
    f"some/path/file.ext",
    my_file_path,
    metadata={"SomeField": "     some value"}
)

Signature mismatch occurs:

minio.error.S3Error: S3 operation failed; code: SignatureDoesNotMatch, message: The request signature we calculated does not match the signature you provided. Check your key and signing method.

When I remove the spaces before some value, put object happens fine.

Looks like there is replacement/removal of spaces happening here:

_MULTI_SPACE_REGEX.sub(" ", value) for value in values
prior to signing which is leading to the signature mismatch.

@sidharthrajaram
Copy link
Author

Tested same thing on Go SDK with no issue.

balamurugana added a commit to balamurugana/minio-py that referenced this issue Aug 17, 2024
Fixes minio#1434

Signed-off-by: Bala.FA <bala@minio.io>
balamurugana added a commit to balamurugana/minio-py that referenced this issue Aug 17, 2024
Fixes minio#1434

Signed-off-by: Bala.FA <bala@minio.io>
balamurugana added a commit to balamurugana/minio-py that referenced this issue Aug 17, 2024
Fixes minio#1434

Signed-off-by: Bala.FA <bala@minio.io>
balamurugana added a commit to balamurugana/minio-py that referenced this issue Aug 17, 2024
Fixes minio#1434

Signed-off-by: Bala.FA <bala@minio.io>
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 a pull request may close this issue.

1 participant