fix(storage): allow S3 without public_url, auto-construct path-style URL from endpoint

This commit is contained in:
2026-07-18 08:17:35 +08:00
parent 4787fdbf22
commit 54d778971d
2 changed files with 3 additions and 22 deletions

View File

@@ -120,7 +120,9 @@ class S3Storage:
k = _strip_prefix(key)
if self.public_url:
return f"{self.public_url}/{k}"
return k
# fallback: path-style URL from endpoint + bucket
ep = self._client._endpoint.host
return f"{ep}/{self.bucket}/{k}"
# ── Helpers ────────────────────────────────────────────────────────