aliyun-UED / aliyun-sdk-js

阿里云 SDK for Javascript,支持在浏览器和 Nodejs 环境使用,支持大部分阿里云服务。
http://www.aliyun.com
779 stars 198 forks source link

OSS getSignedUrl方法算出来的URL签名不正确 #132

Open meteormatt opened 7 years ago

meteormatt commented 7 years ago

http://meteormatt.oss-us-west-1.aliyuncs.com/Mac%E5%9B%BE%E6%A0%87.jpg?response-content-disposition=attachment%3B%20filename%3D%22Mac%E5%9B%BE%E6%A0%87.jpg%22&Expires=1500004831&OSSAccessKeyId=JmEERnI8OpUF21Gw&Signature=%2FHT8hZcmCCkT0u2QyPlKondne7Y%3D

<Error>
  <Code>SignatureDoesNotMatch</Code>
  <Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
  <RequestId>59683B697F5DBADC0D832F9B</RequestId>
  <HostId>meteormatt.oss-us-west-1.aliyuncs.com</HostId>
  <OSSAccessKeyId>JmEERnI8OpUF21Gw</OSSAccessKeyId>
  <SignatureProvided>/HT8hZcmCCkT0u2QyPlKondne7Y=</SignatureProvided>
  <StringToSign>GET

1500004831
/meteormatt/Mac图标.jpg?response-content-disposition=attachment; filename="Mac图标.jpg"</StringToSign>
  <StringToSignBytes>47 45 54 0A 0A 0A 31 35 30 30 30 30 34 38 33 31 0A 2F 6D 65 74 65 6F 72 6D 61 74 74 2F 4D 61 63 E5 9B BE E6 A0 87 2E 6A 70 67 3F 72 65 73 70 6F 6E 73 65 2D 63 6F 6E 74 65 6E 74 2D 64 69 73 70 6F 73 69 74 69 6F 6E 3D 61 74 74 61 63 68 6D 65 6E 74 3B 20 66 69 6C 65 6E 61 6D 65 3D 22 4D 61 63 E5 9B BE E6 A0 87 2E 6A 70 67 22 </StringToSignBytes>
</Error>

https://gist.github.com/meteormatt/68401e435cb97382bc85d4de2b110374

ZevenFang commented 6 years ago

同问,如何签名增加图片处理操作,直接拼接算出来的URL签名不正确