fix: range end is zero-indexed #3826
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This relates to...
The retry interceptor treats the
endparameter of theRangeorContent-Rangeheader as 1-indexed (or 0-indexed but exclusive), leading to an error, for example, when theContent-Rangeheader is not present andendis assigned to the value of theContent-Lengthheader:AssertionError [ERR_ASSERTION]: content-range mismatch at RetryHandler.onHeaders (D:\_\node_modules\undici\lib\handler\retry-handler.js:236:7) at downstreamOnHeaders (D:\_\node_modules\undici\lib\handler\cache-handler.js:64:53) at CacheHandler.onHeaders (D:\_\node_modules\undici\lib\handler\cache-handler.js:112:14) at CookieHandler.onHeaders (D:\_\node_modules\http-cookie-agent\dist\undici\cookie_handler.js:43:28) at Request.onHeaders (D:\_\node_modules\undici\lib\core\request.js:246:29) at Parser.onHeadersComplete (D:\_\node_modules\undici\lib\dispatcher\client-h1.js:612:27) at wasm_on_headers_complete (D:\_\node_modules\undici\lib\dispatcher\client-h1.js:141:30) at wasm://wasm/00032d9a:wasm-function[10]:0x56f at wasm://wasm/00032d9a:wasm-function[20]:0x7d57 at Parser.execute (D:\_\node_modules\undici\lib\dispatcher\client-h1.js:332:22) { generatedMessage: false, code: 'ERR_ASSERTION', actual: false, expected: true, operator: '==' }Rationale
This PR fixes the issue above by subtracting 1 to
Content-Lengthor the size parameter of theContent-RangeheaderChanges
Features
Bug Fixes
Breaking Changes and Deprecations
Status