服务端配置使用阿里云 OSS 作为存储。测试中发现安卓端修改用户头像是正常的,但是iOS端修改头像报失败,跟踪后发现mars的dump数据如下:
> HTTP/1.1 403 Forbidden
> Server: AliyunOSS
> Date: Sat, 03 Oct 2020 14:24:03 GMT
> Content-Type: application/xml
> Content-Length: 913
> Connection: close
> x-oss-request-id: 5F7889838338063136FB903B
> x-oss-server-time: 0
>
> <?xml version="1.0" encoding="UTF-8"?>
> <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>5F7889838338063136FB903B</RequestId>
> <HostId>此处隐藏</HostId>
> <OSSAccessKeyId>此处隐藏</OSSAccessKeyId>
> <SignatureProvided>此处隐藏</SignatureProvided>
> <StringToSign>PUT
>
> image/jpeg
> Sat, 03 Oct 2020 14:23:55 GMT
> /ddian-tech/SeoZSZ44-5-1601735035-sHaZTl3n_.jpg</StringToSign>
> <StringToSignBytes>50 55 54 0A 0A 69 6D 61 67 65 2F 6A 70 65 67 0A 53 61 74 2C 20 30 33 20 4F 63 74 20 32 30 32 30 20 31 34 3A 32 33 3A 35 35 20 47 4D 54 0A 2F 64 64 69 61 6E 2D 74 65 63 68 2F 53 65 6F 5A 53 5A 34 34 2D 35 2D 31 36 30 31 37 33 35 30 33 35 2D 73 48 61 5A 54 6C 33 6E 5F 2E 6A 70 67 </StringToSignBytes>
> </Error>
目前测试,安卓端上传与多媒体相关的内容都正常。iOS端聊天部分涉及多媒体内容上传也是正常,仅头像更新不行。
由于不懂 iOS的代码,目前不知道如何处理。非常感谢您的阅读。