What do I do if an error is reported when I access OSS using WeChat on Android?

Updated at:

Issue description

When you upload a JS file to Object Storage Service (OSS), an error is reported only when you access OSS using WeChat on Android or QQ browser.

Causes

WeChat and QQ add the Content-Type:application/octet-stream header.

Solutions

  1. To perform an upload test, turn on your laptop's Wi-Fi and connect your phone to it.

  2. Use a packet capture tool, such as Wireshark, to inspect the traffic. The captured packets show a signature mismatch error. This error occurs because the software development kit (SDK) does not include the Content-Type:application/octet-stream header when it calculates the signature. However, the browser adds this header when it sends the request. This header must be included in the signature calculation.

  3. After tests, no error is reported when you upload an object after you delete the header. Therefore, the error is reported when the Content-Type:application/octet-stream header is added to WeChat or QQ browser.

  4. Delete the header on WeChat.