Bug 1304633 - Treating resources as finite when the response code is 206.
MozReview-Commit-ID: 13GF2E5IwSs
--- 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;