File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010from trendradar .context import AppContext
1111
12- __version__ = "4.0.1 "
12+ __version__ = "4.0.2 "
1313__all__ = ["AppContext" , "__version__" ]
Original file line number Diff line number Diff line change @@ -93,10 +93,15 @@ def __init__(
9393
9494 # 初始化 S3 客户端
9595 # 使用 virtual-hosted style addressing(主流)
96- # 使用 s3 签名版本(v2),避免 s3v4 签名可能导致的 chunked encoding 问题
96+ # 根据服务商选择签名版本:
97+ # - Cloudflare R2 只支持 SigV4
98+ # - 腾讯云 COS 等使用 SigV2 以避免 chunked encoding 问题
99+ is_cloudflare_r2 = "r2.cloudflarestorage.com" in endpoint_url .lower ()
100+ signature_version = 's3v4' if is_cloudflare_r2 else 's3'
101+
97102 s3_config = BotoConfig (
98103 s3 = {"addressing_style" : "virtual" },
99- signature_version = 's3' , # 使用 S3v2 签名,兼容性更好
104+ signature_version = signature_version ,
100105 )
101106
102107 client_kwargs = {
@@ -114,7 +119,7 @@ def __init__(
114119 self ._downloaded_files : List [Path ] = []
115120 self ._db_connections : Dict [str , sqlite3 .Connection ] = {}
116121
117- print (f"[远程存储] 初始化完成,存储桶: { bucket_name } " )
122+ print (f"[远程存储] 初始化完成,存储桶: { bucket_name } ,签名版本: { signature_version } " )
118123
119124 @property
120125 def backend_name (self ) -> str :
Original file line number Diff line number Diff line change 1- 4.0.1
1+ 4.0.2
You can’t perform that action at this time.
0 commit comments