Bug 893316 - Http.jsm doesn't listen to method option parameter. r=Mossop

This commit is contained in:
Mike Conley 2013-07-15 09:25:57 +02:00
parent 0b6c519766
commit c5fa790685

View File

@ -35,7 +35,7 @@ function httpRequest(aUrl, aOptions) {
.createInstance(Ci.nsIXMLHttpRequest);
xhr.mozBackgroundRequest = true; // no error dialogs
let hasPostData = "postData" in aOptions;
xhr.open("aMethod" in aOptions ? aMethod :
xhr.open("method" in aOptions ? aOptions.method :
(hasPostData ? "POST" : "GET"), aUrl);
xhr.channel.loadFlags = Ci.nsIChannel.LOAD_ANONYMOUS | // don't send cookies
Ci.nsIChannel.LOAD_BYPASS_CACHE |