Skip to content

Fall back to listing for file size when HeadObject omits Content-Length - #1938

Open
IonBazan wants to merge 1 commit into
thephpleague:3.xfrom
IonBazan:fix-zero-byte-file-size
Open

IonBazan wants to merge 1 commit into
thephpleague:3.xfrom
IonBazan:fix-zero-byte-file-size

Conversation

@IonBazan

Copy link
Copy Markdown

This fix makes fileSize() in both S3 adapters read the size from a listing when HeadObject returns no Content-Length, so empty files no longer fail.

Apache mod_proxy drops Content-Length from HEAD responses for empty objects, which breaks fileSize() for S3-compatible storage behind it. The adapter now sends one ListObjectsV2 request and uses the size only if the returned key matches exactly. Otherwise it still throws.

Fixes #1910

This branch has not been deployed

No deployments
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.

Ceph RGW omits Content-Length for zero-byte objects causing fileSize() issues

1 participant