2

On the server side, I have an endpoint that uses the nodejs client of minio to generate a pre-signed URL successfully.

minioclient.presignedPutObject('my_bucket', 'WechatIMG141.png', 24 * 60 *60 , (err, url) => {});

The pre-signed URL is returned back to the client side and the client frontend is using the client to send to minio server, which is running in 9000 port.

http://127.0.0.1:9000/xyu.oa/WechatIMG141.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20220507%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220507T064357Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=3bbcd44425aae3c41b5bdf5e6b3d803f03f823ce90607b5728e6ff839d40211e

The above is the presignedUrl, with the presignedUrl the frontend application is send the raw image data to minio server in http PUT.

         import axios from 'axios'
         console.log('presignedUrl',presignedUrl);

         let uploadResp =  await axios.put( presignedUrl, file_raw) // raw file data
         console.log('uploadResp',uploadResp);

Response:

<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
<Key>WechatIMG141.png</Key>
<BucketName>xyu.oa</BucketName>
<Resource>/xyu.oa/WechatIMG141.png</Resource>
<RequestId>16ECBF0F51910E88</RequestId>
<HostId>2d10bddd-3403-4f93-8984-811b5d9df3bc</HostId>
</Error>

I don't know why the frontend causes the error, any idea

user824624
  • 7,077
  • 27
  • 106
  • 183

0 Answers0