Scraping Proxies and HTTP Range Response Validation
A partial-download workflow needs more evidence than a completed request. A server can return a full representation, a requested range or an error that requires separate handling. When using Go2Proxy data collection for an authorized document transfer, verify the returned representation before appending bytes. The presence of a Range request does not prove that the response contains the fragment your stored offset expects.

Define the unit that is being resumed
Keep the approved resource URL, expected representation identity and completed byte interval together. The offset must refer to the same representation as the next request. A file that changed between attempts may no longer support joining the old and new fragments.
Decide how the workflow detects a changed representation and when it restarts the approved transfer. Do not infer identity from filename alone, particularly when a download URL can generate updated content.
Validate the returned range
Read the response status and any relevant range metadata before accepting the body as a fragment. A full response must not simply be appended after an existing partial file. Handle an unsatisfiable range through the documented recovery policy.
The scraped-data validation guide places representation checks ahead of business acceptance. Apply that principle to the interval boundaries, expected resource and final integrity check, rather than treating a successful network transfer as proof that the assembled document is correct.
Keep byte accounting consistent
Offsets and fragment lengths need a precise representation context. Automatic decoding or a changed content-coding choice can make stored byte positions refer to a different sequence than the application expects.
Use the transfer method and client behavior supported for the resource. Keep the raw transfer accounting separate from any extracted text or decoded document size. A parser's character count cannot establish the next byte position for a resumed binary download.
Test a changed-file case
Use a small owned fixture with a known byte sequence. Interrupt one transfer, then resume against an unchanged representation and verify the exact final sequence. Separately replace the fixture before the next attempt and confirm that the application detects the mismatch.
Include a server response that ignores the requested range. The test should prevent duplicate content from being appended merely because the response returned an apparently successful status.
Finish with document-level acceptance
After the fragments are assembled, verify the final expected length and an appropriate integrity marker supplied or controlled by the approved source. Then validate that the intended document can be read correctly.
Retain failed fragments as temporary diagnostic material only when needed and permitted. A transfer that exhausted its deadline should remain incomplete in reporting. Do not publish the partial file under the same status as an accepted complete document.
Frequently asked questions
Does sending Range guarantee a partial response?
No. Validate the actual response and handle a full representation separately. The requested interval alone is insufficient evidence for appending data.
Can a filename prove fragments belong together?
No. A source can reuse a name for changed content. Preserve representation identity and verify the assembled result before acceptance.
Should decoded character counts become resume offsets?
No. Character counts and transfer-byte positions describe different units. Use the representation and byte-accounting rules supported by the transfer workflow.
Before the next run
Keep unchanged, changed and ignored-range fixtures with the downloader acceptance tests. They exercise different failure modes around the same resume boundary.



