Files
floci/src/main/java
Mihai BlidaruandMihai Blidaru 48f310b63f fix(s3): omit checksum headers from GetObject/HeadObject unless x-amz-checksum-mode: ENABLED (#1633)
* fix(s3): omit checksum headers from GetObject/HeadObject unless x-amz-checksum-mode: ENABLED

Real AWS only returns x-amz-checksum-* headers on GetObject and HeadObject
responses when the client sends x-amz-checksum-mode: ENABLED. Without that
header, returning the checksum causes the PHP AWS SDK to attempt checksum
validation on a non-seekable streaming response body, throwing
"Stream is not seekable" and making fopen fail.

Closes #1632

* refactor(s3): drop dead appendObjectHeaders overloads, dedupe test @Order

Addresses Greptile review on PR #1633:

- Remove the now-unreachable 2-arg and 3-arg appendObjectHeaders overloads.
  All real callers pass includeChecksum explicitly to the 4-arg version, so the
  3-arg overload's hard-coded `true` was a footgun that could silently re-emit
  checksum headers. Also drops the now-orphaned ResponseHeaderOverrides.NONE.
- Move getObjectWithChecksumModeReturnsChecksum / headObjectWithChecksumMode...
  to the end of the 5-22 test block with unique @Order(23)/@Order(24), so they
  no longer share @Order(5)/@Order(7) with getObject/headObject.

All 117 S3IntegrationTest cases pass.

* fix(s3): include checksum in empty-object suffix-range response when requested

The empty-object suffix-range path returns a full 200 via fullObjectResponse
instead of a 206, so it must honor x-amz-checksum-mode: ENABLED like any
other full-object response. It previously hardcoded includeChecksum=false,
omitting the checksum even when the client asked for it.

Also extends the existing suffix-range test to assert the checksum is
omitted without the header, and adds a new test covering the
x-amz-checksum-mode: ENABLED case.

* fix(s3): resolve rebase-onto-main test conflicts for checksum-mode gate

Sends x-amz-checksum-mode: ENABLED on the GetObject verification calls
that require checksum headers in the response (copyObject,
copyObjectWithoutChecksumOverride, copyObjectPreservesNonDefaultChecksum),
consistent with the behavioral fix in this branch. Adds
getObjectWithChecksumModeReturnsChecksum and
headObjectWithChecksumModeReturnsChecksum as self-contained tests with
unique, non-colliding @Order values.

---------

Co-authored-by: Mihai Blidaru <mihai.blidaru@lynxfctech.com>
2026-07-10 23:12:43 -05:00
..