mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 789732 - Send HTTP header to differentiate addon updates from normal file downloads. r=Unfocused
This commit is contained in:
parent
6a6a991c4f
commit
a47e351807
@ -408,6 +408,7 @@ function UpdateParser(aId, aUpdateKey, aUrl, aObserver) {
|
||||
// Prevent the request from writing to cache.
|
||||
this.request.channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
|
||||
this.request.overrideMimeType("text/xml");
|
||||
this.request.setRequestHeader("Moz-XPI-Update", "1", true);
|
||||
this.request.timeout = TIMEOUT;
|
||||
var self = this;
|
||||
this.request.addEventListener("load", function loadEventListener(event) { self.onLoad() }, false);
|
||||
|
@ -5244,8 +5244,11 @@ AddonInstall.prototype = {
|
||||
|
||||
this.channel = NetUtil.newChannel(this.sourceURI);
|
||||
this.channel.notificationCallbacks = this;
|
||||
if (this.channel instanceof Ci.nsIHttpChannelInternal)
|
||||
this.channel.forceAllowThirdPartyCookie = true;
|
||||
if (this.channel instanceof Ci.nsIHttpChannel) {
|
||||
this.channel.setRequestHeader("Moz-XPI-Update", "1", true);
|
||||
if (this.channel instanceof Ci.nsIHttpChannelInternal)
|
||||
this.channel.forceAllowThirdPartyCookie = true;
|
||||
}
|
||||
this.channel.asyncOpen(listener, null);
|
||||
|
||||
Services.obs.addObserver(this, "network:offline-about-to-go-offline", false);
|
||||
|
Loading…
Reference in New Issue
Block a user