yutianjiang39 opened a new pull request, #923:
URL: https://github.com/apache/arrow-rs-object-store/pull/923

   # Which issue does this PR close?
   
   Closes #902.
   
   # Rationale for this change
   
   A server can send a valid `Content-Range` and then end the body cleanly 
after sending only part of that range. `get_range` could return those bytes as 
a successful read.
   
   # What changes are included in this PR?
   
   `GetResult::bytes()` now compares the collected stream length with 
`range.end - range.start`. The check runs after collection, so it also covers 
bodies assembled across retries. The existing successful retry test now 
supplies all four bytes of its final range.
   
   The regression test uses a chunked 206 retry response with `Content-Range: 
bytes 0-9/10` and no `Content-Length`. It sends only `hello`. With just the 
test added, the baseline returned `Ok(b"hello")` for `get_range(0..10)`. With 
the patch, the call returns an error reporting 10 bytes expected and 5 
received. The test also covers short, exact, and oversized bodies on an initial 
206 response with a nonzero range offset.
   
   The offline library and integration test run with the `http` feature passed 
134 tests. One test was marked ignored, and the run excluded 
`test_http_store_gzip` because it fetches a file from GitHub.
   
   # Are there any user-facing changes?
   
   Yes. A stream that yields too few or too many bytes now produces an error 
from `bytes()` and `get_range`. The check applies only when collecting the 
body. Direct stream consumers, retry handling, and HEAD range semantics are 
outside its scope.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to