mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-11 21:58:41 +02:00
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:
parent
90f6351901
commit
13772225f5
1 changed files with 8 additions and 1 deletions
|
|
@ -71,10 +71,17 @@ function handleRequest(aRequest, aResponse) {
|
||||||
// mar will be downloaded asynchronously which will allow the ui to load
|
// mar will be downloaded asynchronously which will allow the ui to load
|
||||||
// before the download completes.
|
// before the download completes.
|
||||||
if (params.slowDownloadMar) {
|
if (params.slowDownloadMar) {
|
||||||
let retries = 0;
|
|
||||||
aResponse.processAsync();
|
aResponse.processAsync();
|
||||||
aResponse.setHeader("Content-Type", "binary/octet-stream");
|
aResponse.setHeader("Content-Type", "binary/octet-stream");
|
||||||
aResponse.setHeader("Content-Length", SIZE_SIMPLE_MAR);
|
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 = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||||
gSlowDownloadTimer.initWithCallback(function(aTimer) {
|
gSlowDownloadTimer.initWithCallback(function(aTimer) {
|
||||||
let continueFile = getTestDataFile(CONTINUE_DOWNLOAD);
|
let continueFile = getTestDataFile(CONTINUE_DOWNLOAD);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue