Nugine / s3s

S3 Service Adapter
Apache License 2.0
144 stars 34 forks source link

Fix range requests for GetObject #128

Closed nomick closed 9 months ago

nomick commented 9 months ago

RFC 9110 states:

A valid ranges-specifier is "satisfiable" if it contains at least one range-spec that is satisfiable, as defined by the indicated range-unit. Otherwise, the ranges-specifier is "unsatisfiable".

Thus, one may not reject a range request that exceeds file length. This PR allows for requesting a too long range from s3-fs, which will silently be cropped to maximum length. This also matches the functionality of Minio and Rados gateway.

Furthermore, the Content-Range header is filled in accordance to RFC 9110.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.