全部產品
Search
文件中心

Object Storage Service:0048-00000200

更新時間:Feb 28, 2024

問題描述

通過OSS預設公網網域名稱訪問2023年08月15日後建立的Bucket中尾碼為.apk或者.ipa的檔案,伺服器返回400錯誤。

問題原因

出於安全考慮,自2023年08月15日起,針對該日期之後建立的Bucket,如果通過OSS預設公網網域名稱(bucketname.oss-[region].aliyuncs.com)或傳輸加速網域名稱(bucketname.oss-accelerate.aliyuncs.com或bucketname.oss-accelerate-overseas.aliyuncs.com)訪問其中尾碼為.apk或者.ipa的檔案,使用URL簽章要求或匿名訪問請求將被阻斷。伺服器返回400錯誤,錯誤碼為ApkDownloadForbidden。 

問題樣本

以下請求使用OSS公網網域名稱匿名訪問.apk檔案,伺服器返回400錯誤。

GET /test.apk HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com

HTTP/1.1 400 Bad Request
Server: AliyunOSS

<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>ApkDownloadForbidden</Code>
  <Message>The APK file is not allowed to be distributed in a public network using the OSS endpoint, please use CNAME instead.</Message>
  <RequestId>xxxxxxxxxxxxx</RequestId>
  <HostId>oss-example.oss-cn-hangzhou.aliyuncs.com</HostId>
</Error>

解決方案

使用自有網域名稱訪問上述檔案時將不會被阻斷。如何使用自有網域名稱訪問OSS,請參見綁定自訂網域名至Bucket預設網域名稱