Bug 1383404 - Part 5. PageIconProtocolHandler should set the content length when creating a channel. r=mak
authorAndrew Osmond <aosmond@mozilla.com>
Tue, 01 Aug 2017 06:59:12 -0400
changeset 420920 41faadcda947800651995e706f2f4e547832db4e
parent 420919 729621d1ffac9f5c761222c3ab3df08e97530040
child 420921 7d01cd53da023a9080cb7a529a4190c51dd97d97
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1383404
milestone56.0a1
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 1383404 - Part 5. PageIconProtocolHandler should set the content length when creating a channel. r=mak
toolkit/components/places/PageIconProtocolHandler.js
--- a/toolkit/components/places/PageIconProtocolHandler.js
+++ b/toolkit/components/places/PageIconProtocolHandler.js
@@ -97,16 +97,17 @@ PageIconProtocolHandler.prototype = {
       let pageURI = NetUtil.newURI(uri.path.replace(/[&#]size=[^&]+$/, ""));
       let preferredSize = PlacesUtils.favicons.preferredSizeFromURI(uri);
       PlacesUtils.favicons.getFaviconDataForPage(pageURI, (iconURI, len, data, mimeType) => {
         if (len == 0) {
           streamDefaultFavicon(uri, loadInfo, pipe.outputStream, channel);
         } else {
           try {
             channel.contentType = mimeType;
+            channel.contentLength = len;
             serveIcon(pipe, data, len);
           } catch (ex) {
             streamDefaultFavicon(uri, loadInfo, pipe.outputStream, channel);
           }
         }
       }, preferredSize);
 
       return channel;