Skip to content

Commit 052bf0b

Browse files
authored
Fix: S3 checksum conflict in ActiveStorage uploads (MIRU-WEB-3G) (#2054)
fixing "You can only specify one non-default checksum at a time" error with aws-sdk-s3 >= 1.208.0.
1 parent 9022ae6 commit 052bf0b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

config/storage.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ cloudflare:
1414
region: <%= ENV['CLOUDFLARE_R2_REGION'] %>
1515
bucket: <%= ENV['CLOUDFLARE_R2_BUCKET_NAME'] %>
1616
endpoint: <%= ENV['CLOUDFLARE_R2_ENDPOINT'] %>
17+
# Disable automatic checksum calculation to avoid conflicts with content_md5
18+
# AWS SDK >= 1.208.0 adds checksum_algorithm by default, which conflicts with ActiveStorage's content_md5
19+
# Setting to 'when_required' reverts to previous behavior compatible with S3-compatible services
20+
request_checksum_calculation: when_required
21+
response_checksum_validation: when_required
1722

1823
# Remember not to checkin your GCS keyfile to a repository
1924
# google:

0 commit comments

Comments
 (0)