Skip to content

Fix Content-Range response header for EncryptedBlobStore range requests#921

Merged
gaul merged 2 commits intogaul:masterfrom
polarctos:fix-encrypted-blobstore-response-content-range-headers
Nov 4, 2025
Merged

Fix Content-Range response header for EncryptedBlobStore range requests#921
gaul merged 2 commits intogaul:masterfrom
polarctos:fix-encrypted-blobstore-response-content-range-headers

Conversation

@polarctos
Copy link
Contributor

For HTTP requests with a Range header, it is generally expected to have a Content-Range response header.

Some clients rely on this response header being present, but the EncryptedBlobStore.java implementation did not add this header to the response.

Especially the peculiar range request Range: bytes=0-0 is used by some clients to determine the full length of the object.
A HEAD request would be more appropriate in this case, but nevertheless clients like this exist. E.g. the GitLab pages app.
The expected response header in this case is then in the format Content-Range: bytes 0-0/<size>.

To fix this, this PR adds the Content-Range header to the response if the request included a Range header.
Test were adapted to verify the header and also for the specific "double zero" range request for the EncryptedBlobStore.

@gaul gaul merged commit 6355f78 into gaul:master Nov 4, 2025
3 checks passed
@gaul
Copy link
Owner

gaul commented Nov 4, 2025

Thank you for your contribution @polarctos!

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.

2 participants