Bug 1304633 - Treating resources as finite when the response code is 206. draft
authorJW Wang <jwwang@mozilla.com>
Thu, 22 Sep 2016 15:15:01 +0800
changeset 416853 261ebf4a551f99cfb17655d5af3414ddfdf3fb44
parent 416852 bfecef8e440beeeccf3968b5f56bed53703c4e67
child 417511 4e435cb8f41a1b65cdf42801390c5b44d3777c57
push id30265
push userjwwang@mozilla.com
push dateFri, 23 Sep 2016 06:07:16 +0000
bugs1304633
milestone52.0a1
Bug 1304633 - Treating resources as finite when the response code is 206. MozReview-Commit-ID: 13GF2E5IwSs
dom/media/MediaResource.cpp
--- a/dom/media/MediaResource.cpp
+++ b/dom/media/MediaResource.cpp
@@ -217,17 +217,19 @@ ChannelMediaResource::OnStartRequest(nsI
     hc->GetResponseHeader(NS_LITERAL_CSTRING("Accept-Ranges"),
                           ranges);
     bool acceptsRanges = ranges.EqualsLiteral("bytes");
     // True if this channel will not return an unbounded amount of data
     bool dataIsBounded = false;
 
     int64_t contentLength = -1;
     hc->GetContentLength(&contentLength);
-    if (contentLength >= 0 && responseStatus == HTTP_OK_CODE) {
+    if (contentLength >= 0 &&
+        (responseStatus == HTTP_OK_CODE ||
+         responseStatus == HTTP_PARTIAL_RESPONSE_CODE)) {
       // "OK" status means Content-Length is for the whole resource.
       // Since that's bounded, we know we have a finite-length resource.
       dataIsBounded = true;
     }
 
     // Assume Range requests have a bounded upper limit unless the
     // Content-Range header tells us otherwise.
     bool boundedSeekLimit = true;