Bug 614760 - Don't send 'Accept-Encoding: gzip,deflate' for video. r=doublec a=roc
authorBen Bucksch <ben.bucksch@beonex.com>
Mon, 29 Nov 2010 10:21:27 +1300
changeset 58314 c194928bb4a9dd39006ab33f114aceff96518f28
parent 58313 00ea82fd6c59e927f4d78d4d5a78fd2a3329ff31
child 58315 a5ec817740f0047309cb284a9b145e240719c81d
push id17240
push usercpearce@mozilla.com
push dateSun, 28 Nov 2010 21:21:58 +0000
treeherdermozilla-central@c194928bb4a9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdoublec, roc
bugs614760
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 614760 - Don't send 'Accept-Encoding: gzip,deflate' for video. r=doublec a=roc
content/html/content/src/nsHTMLMediaElement.cpp
--- a/content/html/content/src/nsHTMLMediaElement.cpp
+++ b/content/html/content/src/nsHTMLMediaElement.cpp
@@ -2566,16 +2566,24 @@ nsresult nsHTMLMediaElement::GetBuffered
   return NS_OK;
 }
 
 void nsHTMLMediaElement::SetRequestHeaders(nsIHttpChannel* aChannel)
 {
   // Send Accept header for video and audio types only (Bug 489071)
   SetAcceptHeader(aChannel);
 
+  // Apache doesn't send Content-Length when gzip transfer encoding is used,
+  // which prevents us from estimating the video length (if explicit Content-Duration
+  // and a length spec in the container are not present either) and from seeking.
+  // So, disable the standard "Accept-Encoding: gzip,deflate" that we usually send.
+  // See bug 614760.
+  aChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept-Encoding"),
+                             NS_LITERAL_CSTRING(""), PR_FALSE);
+
   // Set the Referer header
   nsIDocument* doc = GetOwnerDoc();
   if (doc) {
     aChannel->SetReferrer(doc->GetDocumentURI());
   }
 }
 
 void nsHTMLMediaElement::FireTimeUpdate(PRBool aPeriodic)