Bug 844175 - Twitter stays on Connecting: Requesting user timelines... - follow-up to fix FileLink bustage, rs=mconley.

This commit is contained in:
Florian Quèze 2013-03-06 15:43:15 +01:00
Родитель 165f5f5a72
Коммит 14bd8d64f2
2 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -59,8 +59,12 @@ function doXHRequest(aUrl, aHeaders, aPOSTData, aOnLoad, aOnError, aThis,
});
}
let POSTData = "";
if (Array.isArray(aPOSTData)) {
// aPOSTData can be:
// - a string: send it as is
// - an array of parameters: encode as form values
// - null/undefined: no POST data.
let POSTData = aPOSTData || "";
if (Array.isArray(POSTData)) {
xhr.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded; charset=utf-8");
POSTData = aPOSTData.map(function(p) p[0] + "=" + encodeURIComponent(p[1]))

Просмотреть файл

@ -59,8 +59,12 @@ function doXHRequest(aUrl, aHeaders, aPOSTData, aOnLoad, aOnError, aThis,
});
}
let POSTData = "";
if (Array.isArray(aPOSTData)) {
// aPOSTData can be:
// - a string: send it as is
// - an array of parameters: encode as form values
// - null/undefined: no POST data.
let POSTData = aPOSTData || "";
if (Array.isArray(POSTData)) {
xhr.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded; charset=utf-8");
POSTData = aPOSTData.map(function(p) p[0] + "=" + encodeURIComponent(p[1]))