Bug 893316 - Http.jsm doesn't listen to method option parameter. r=Mossop
authorMike Conley <mconley@mozilla.com>
Mon, 15 Jul 2013 09:25:57 +0200
changeset 138491 a862c3557b27dccd5579dddf1c60678b0b68de72
parent 138490 fb87ff45a4540f59b72146e7588589e48c77787c
child 138492 f8b9e399e92f62c474f40207512199c7df5e2a1e
push id24959
push userryanvm@gmail.com
push dateMon, 15 Jul 2013 21:03:59 +0000
treeherdermozilla-central@e5d74eebd0e2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop
bugs893316
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 893316 - Http.jsm doesn't listen to method option parameter. r=Mossop
toolkit/modules/Http.jsm
--- a/toolkit/modules/Http.jsm
+++ b/toolkit/modules/Http.jsm
@@ -30,17 +30,17 @@ function percentEncode(aString)
  * array the first value is the key and the second is the value, e.g.
  *  [["key1", "value1"], ["key2", "value2"]].
  */
 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;
-  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 |
                           Ci.nsIChannel.INHIBIT_CACHING;
   xhr.onerror = function(aProgressEvent) {
     if ("onError" in aOptions) {
       // adapted from toolkit/mozapps/extensions/nsBlocklistService.js
       let request = aProgressEvent.target;