lib/rest: validate ranged responses

Add response validation for calls made with Range open options. Verify
Content-Range, Content-Length, response status, and the complete
representation size before a backend accepts the response body.

Return a shared sentinel when a server ignores a partial range so callers
can avoid retrying the same unsupported request.
This commit is contained in:
Morax
2026-08-14 18:40:40 +02:00
committed by Nick Craig-Wood
parent 5a0b7d6746
commit 69e5aff2a9
3 changed files with 345 additions and 0 deletions
+1
View File
@@ -53,6 +53,7 @@ var (
ErrorFileNameTooLong = errors.New("file name too long")
ErrorCantListRoot = errors.New("can't list root")
ErrorFileTooSmall = errors.New("file too small for multipart upload")
ErrorRangeIgnored = errors.New("server ignored requested range")
)
// FileTooSmallError is returned by OpenChunkWriter when a file is below the