Quellcode durchsuchen

fix: 改进与特定 S3 兼容端点的兼容性

sansan vor 3 Monaten
Ursprung
Commit
e1819d6bef
3 geänderte Dateien mit 6 neuen und 6 gelöschten Zeilen
  1. 1 1
      trendradar/__init__.py
  2. 4 4
      trendradar/storage/remote.py
  3. 1 1
      version

+ 1 - 1
trendradar/__init__.py

@@ -9,5 +9,5 @@ TrendRadar - 热点新闻聚合与分析工具
 
 from trendradar.context import AppContext
 
-__version__ = "5.5.0"
+__version__ = "5.5.1"
 __all__ = ["AppContext", "__version__"]

+ 4 - 4
trendradar/storage/remote.py

@@ -93,10 +93,10 @@ class RemoteStorageBackend(SQLiteStorageMixin, StorageBackend):
         # 初始化 S3 客户端
         # 使用 virtual-hosted style addressing(主流)
         # 根据服务商选择签名版本:
-        # - 腾讯云 COS 使用 SigV2 以避免 chunked encoding 问题
-        # - 其他服务商(AWS S3、Cloudflare R2、阿里云 OSS、MinIO 等)默认使用 SigV4
-        is_tencent_cos = "myqcloud.com" in endpoint_url.lower()
-        signature_version = 's3' if is_tencent_cos else 's3v4'
+        # - 腾讯云 COS 和 阿里云 OSS 使用 SigV2 以避免 chunked encoding 问题
+        # - 其他服务商(AWS S3、Cloudflare R2、MinIO 等)默认使用 SigV4
+        use_sigv2 = "myqcloud.com" in endpoint_url.lower() or "aliyuncs.com" in endpoint_url.lower()
+        signature_version = 's3' if use_sigv2 else 's3v4'
 
         s3_config = BotoConfig(
             s3={"addressing_style": "virtual"},

+ 1 - 1
version

@@ -1 +1 @@
-5.5.0
+5.5.1