Bug 1119235 - Use null for xhr.send if no postData. r=Mossop

--HG--
extra : rebase_source : 0279058dc09dd0d31971191a6f5edfbe48da0fd7
This commit is contained in:
Mike Kaply 2015-01-15 13:56:33 -06:00
parent f750a7bdbf
commit dc130e7588

View File

@ -83,8 +83,8 @@ function httpRequest(aUrl, aOptions) {
}
// Handle adding postData as defined above.
let POSTData = aOptions.postData || "";
if (Array.isArray(POSTData)) {
let POSTData = aOptions.postData || null;
if (POSTData && Array.isArray(POSTData)) {
xhr.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded; charset=utf-8");
POSTData = POSTData.map(function(p) p[0] + "=" + percentEncode(p[1]))