(err)
| 9537 | } |
| 9538 | const { start, size, end = size - 1 } = range; |
| 9539 | assert( |
| 9540 | start != null && Number.isFinite(start), |
| 9541 | "content-range mismatch" |
| 9542 | ); |
| 9543 | assert(end != null && Number.isFinite(end), "invalid content-length"); |
| 9544 | this.start = start; |
| 9545 | this.end = end; |
| 9546 | } |
| 9547 | if (this.end == null) { |
| 9548 | const contentLength = headers["content-length"]; |
| 9549 | this.end = contentLength != null ? Number(contentLength) - 1 : null; |
| 9550 | } |
| 9551 | assert(Number.isFinite(this.start)); |
| 9552 | assert( |
| 9553 | this.end == null || Number.isFinite(this.end), |
| 9554 | "invalid content-length" |
| 9555 | ); |
| 9556 | this.resume = resume; |
| 9557 | this.etag = headers.etag != null ? headers.etag : null; |
| 9558 | if (this.etag != null && this.etag.startsWith("W/")) { |
| 9559 | this.etag = null; |
| 9560 | } |
| 9561 | return this.handler.onHeaders( |
| 9562 | statusCode, |
| 9563 | rawHeaders, |
| 9564 | resume, |
| 9565 | statusMessage |
| 9566 | ); |
| 9567 | } |
| 9568 | const err = new RequestRetryError("Request failed", statusCode, { |
| 9569 | headers, |
| 9570 | data: { count: this.retryCount } |
| 9571 | }); |
| 9572 | this.abort(err); |
| 9573 | return false; |
| 9574 | } |
| 9575 | onData(chunk) { |
| 9576 | this.start += chunk.length; |
| 9577 | return this.handler.onData(chunk); |
| 9578 | } |
| 9579 | onComplete(rawTrailers) { |
| 9580 | this.retryCount = 0; |
nothing calls this directly
no test coverage detected