Bug 1547216 - Make the browser chrome test app_update.sjs handle HEAD requests for BITS downloads. r=bytesized

Differential Revision: https://phabricator.services.mozilla.com/D28980

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Robert Strong 2019-04-26 15:58:46 +00:00
parent 90f6351901
commit 13772225f5

View file

@ -71,10 +71,17 @@ function handleRequest(aRequest, aResponse) {
// mar will be downloaded asynchronously which will allow the ui to load
// before the download completes.
if (params.slowDownloadMar) {
let retries = 0;
aResponse.processAsync();
aResponse.setHeader("Content-Type", "binary/octet-stream");
aResponse.setHeader("Content-Length", SIZE_SIMPLE_MAR);
// BITS will first make a HEAD request followed by a GET request.
if (aRequest.method == "HEAD") {
aResponse.finish();
return;
}
let retries = 0;
gSlowDownloadTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
gSlowDownloadTimer.initWithCallback(function(aTimer) {
let continueFile = getTestDataFile(CONTINUE_DOWNLOAD);