huhx / flutter_oss_aliyun

阿里云oss sdk的flutter版本
MIT License
61 stars 23 forks source link

The getSignedUrl method has a probability of signature mismatch #11

Closed panhuiAipami closed 1 year ago

panhuiAipami commented 1 year ago

String url = await Client().getSignedUrl(path,expireSeconds:10*60); When I add pictures one by one, two or three of them will have mismatched signatures, even if I set the expiration time to ten minutes or more

so Then I try to call getSignedUrls for these pictures once, and they still exist

huhx commented 1 year ago

String url = await Client().getSignedUrl(path,expireSeconds:10*60); When I add pictures one by one, two or three of them will have mismatched signatures, even if I set the expiration time to ten minutes or more

so Then I try to call getSignedUrls for these pictures once, and they still exist

It could be nice if you can provide detailed error message. I have tested with some files, it works fine.

panhuiAipami commented 1 year ago

When I upload the third picture, it appears

Error picture address:https://xxx-shenzhen.aliyuncs.com/xxx/13/77/71745b3e08dc44476e6f15c822701eab.jpg?OSSAccessKeyId=STS.NUE4bfCE47ETB3Bup5ArGBF6o&Expires=1669018664&Signature=XXgI+8juiHGmf0n4T9hYrVlZVmU=&security-token=CAIS1AJ1q6Ft5B2yfSjIr5bwf9jSrpoVgIe/QBXzkXBgTf1rrYOdjTz2IHxFeXJvA%2B0WtPQ3mWlW7fYeloJcZqN9eHDzPZV548pd%2BlnkPYObtYnp4%2BEJzZT5FDDWVRDxh8LeOrqmRtjTIiJ01vJlzn0d%2B6DzUBn/dbPMU/TQ%2B3cODLk%2BWg2/ckAYZrN/LRdjr8k3LGbYMe3XXDfhnmvXCjge2G97kngtxqmj5cee5xHC7jj90fRHn5ntBZKmYsJwRr8dNe24x%2BtrbKHM/TdN4hxRjsdMgbdD5C3Ms6PRYRNY6A7UNPHPoJ89bl1yfq8xErQBt%2BT7j/A/lsHt0I/9z1EPH5kMCXyEH9z/nZCeQb3za45jT9uhZSSRiOLoH4LurgYpbUgcMA53YNc7Ihdyc0dwG2yBdfX6qAqaOlr6FfPVjLtSyYd/y1Tj%2BsGRPESUUxs6cb/ynGZWGoABd8LtxqAkdGKgVxZ98SDQ7zA%2BSJubt6nw2MnFDXiK62hqXAbTv/YPj5XMM5oghZz7CnBSWtglBHTB9aymz2IeR7G6CxDtjmBCp295WUp6UKvQ%2BTMnqjK/ov7DRuATK7iUHv5utRq2x57Z54NyBnt7JTPK0SawoONWJvVoMboLMt8=

error

panhuiAipami commented 1 year ago

I checked the java sdk and found that the key and value of the parameter splicing were urlEncoded, as shown in the figure. The error link Signature above contains a "+" sign. Is this the reason java SDK

huhx commented 1 year ago

Thanks, ^3.1.3 fix the issue.

https://juejin.cn/post/6844903700771667981

panhuiAipami commented 1 year ago

OK,Thank you for your selfless dedication