Skip to content

fix: S3/R2 附件下载走统一存储代理 - #570

Open
mllt992 wants to merge 1 commit into
maillab:mainfrom
mllt992:fix/s3-attachment-download-upstream
Open

mllt992 wants to merge 1 commit into
maillab:mainfrom
mllt992:fix/s3-attachment-download-upstream

Conversation

@mllt992

@mllt992 mllt992 commented Sep 8, 2026

Copy link
Copy Markdown

Summary

  • Configuring S3 made attachment send work, but open/download still failed: /attachments/* always read from KV, ignoring S3/R2.
  • Route /attachments, /static, and /oss through r2Service.toObjResp so KV / R2 / S3 share one download path.
  • Clarify OSS domain UX: leave empty for KV or S3 (this site proxies); fill in only for a public R2/S3 CDN domain.
  • When OSS domain is empty, attachment URLs use a root-absolute path (/attachments/...) so deep routes do not break relative links.

Test plan

  • With S3 configured and OSS domain empty: attachment preview/download works
  • /attachments/<key>, /oss/<key>, /api/oss/<key> all fetch from S3
  • Without S3 (KV or R2 only): attachments still work as before
  • Public R2/CDN domain still used when configured

Originally fixed and merged on the fork: mllt992#4

Downloads previously always hit KV at /attachments/*, so S3 uploads could send but not open.
Route /attachments, /static, and /oss through r2Service.toObjResp, clarify empty OSS domain UX, and make empty-domain attachment URLs root-absolute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant