Bug 894367 - Handle null postData properly in Http.jsm, r=Mossop.

This commit is contained in:
Patrick Cloke 2013-07-25 21:36:19 -04:00
parent 2297263a26
commit 64c2e0ae05

View File

@ -34,7 +34,7 @@ function httpRequest(aUrl, aOptions) {
let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
.createInstance(Ci.nsIXMLHttpRequest);
xhr.mozBackgroundRequest = true; // no error dialogs
let hasPostData = "postData" in aOptions;
let hasPostData = "postData" in aOptions && aOptions.postData;
xhr.open("method" in aOptions ? aOptions.method :
(hasPostData ? "POST" : "GET"), aUrl);
xhr.channel.loadFlags = Ci.nsIChannel.LOAD_ANONYMOUS | // don't send cookies