我正在尝试构建一个 Web 应用程序,该应用程序应获取预签名的 Amazon S3 URL,然后使用 Knox 将文件上传到该 URL。
但是,当我尝试访问我的存储桶时,S3 给了我这个错误
<Error><Code>InvalidArgument</Code><Message>Only one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified</Message><ArgumentName>Authorization</ArgumentName><ArgumentValue>Bearer *****bearer token*****</ArgumentValue><RequestId>1AFD8C7FD2D7E667</RequestId><HostId>ID</HostId></Error>
我可以看到我对 Amazon 的请求不仅包含我的 Amazon 密钥,还包含我的 Authorization Header
https://bucket.s3-eu-west-1.amazonaws.com/image.jpg?Expires=1418226249&AWSAccessKeyId=<key>&Signature=DHYCio7Oao%2BnzPWiiWkGlHb0NAU%3D
和标题 Authorization:Bearer
代码看起来像
$http.post(image, data, {headers: { 'Authorization': null }, withCredentials: false} ).success(function (url) {
item.images[0] = url;
$http.post('/api/item', item);
});
对于不指向我的域的请求,如何摆脱授权令牌?
问候