我正在尝试让新的 Backblaze 兼容 S3 API 与预签名 URL 一起使用
我用来生成 URL 的代码(原始来源):
const aws = require('aws-sdk');
const s3 = new aws.S3({
accessKeyId: 'XXX',
secretAccessKey: 'XXX',
endpoint: 's3.us-west-002.backblazeb2.com',
});
const myBucket = 'bucket-name'
const myKey = 'file-name.pdf'
const signedUrlExpireSeconds = 60 * 5 // I know this is not supported yet.
const url = s3.getSignedUrl('getObject', {
Bucket: myBucket,
Key: myKey,
Expires: signedUrlExpireSeconds
})
console.log(url)
网址已正确生成:
https://BUCKETNAME.s3.us-west-002.backblazeb2.com/BUCKETKEY?AWSAccessKeyId=XXX&Expires=XXX&Signature=XXX
但是当转到浏览器中生成的 URL 时,我得到以下错误:
<Error>
<Code>InvalidRequest</Code>
<Message>Invalid request parameter received: AWSAccessKeyId</Message>
</Error>
我究竟做错了什么?