Don't deliver segments that have been aborted
If an XHR times out, don't ever send the response bytes.
Showing
1 changed file
with
3 additions
and
0 deletions
... | @@ -204,6 +204,9 @@ | ... | @@ -204,6 +204,9 @@ |
204 | if (remaining - value.bandwidth <= 0) { | 204 | if (remaining - value.bandwidth <= 0) { |
205 | // send the response body once all bytes have been delivered | 205 | // send the response body once all bytes have been delivered |
206 | setTimeout(function() { | 206 | setTimeout(function() { |
207 | if (request.aborted) { | ||
208 | return; | ||
209 | } | ||
207 | request.status = 200; | 210 | request.status = 200; |
208 | request.response = new Uint8Array(segmentSize * 0.125); | 211 | request.response = new Uint8Array(segmentSize * 0.125); |
209 | request.setResponseBody(''); | 212 | request.setResponseBody(''); | ... | ... |
-
Please register or sign in to post a comment