minio / minio-js

MinIO Client SDK for Javascript
https://docs.min.io/docs/javascript-client-quickstart-guide.html
Apache License 2.0
904 stars 265 forks source link

SignatureDoesNotMatch error with non-ASCII metadata #1300

Open aileo opened 1 month ago

aileo commented 1 month ago

Hello,

I am not sure if this is a bug or not, if it is related to the js client or minio...

I got 'S3Error: The request signature we calculated does not match the signature you provided. Check your key and signing method.' while other users did not while uploading some file to our dockerized minio on local development environment.

After a lot of reading about minio and reverse proxies, which does not apply in my case, I found out it was because we store author firstname in metadata and mine has an accented character in it.

As I did not find any resources about this while searching about this error, I thought it would be a good idea to write about it somewhere, let me know if here is not the best place.

prakashsvmx commented 1 month ago

Yes.

 await minioClient.putObject("test-bucket", "test.txt", fileStream, stats.size,{
        "x-amz-tagging":"Key1=Value3",
        "test-meta":"meta key",
       //  "firstname": "Léo" // This fails. 
    })

I checked minio-go it works. i will investigate further in this sdk

prakashsvmx commented 1 month ago

Mostly how the header values are encoded while request is sent. needs investigation.