diff --git a/src/ajax.js b/src/ajax.js index 1402c5af0..2612fa9da 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -256,11 +256,11 @@ return xhr } - if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name] - var async = 'async' in settings ? settings.async : true xhr.open(settings.type, settings.url, async, settings.username, settings.password) + if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name] + for (name in headers) nativeSetHeader.apply(xhr, headers[name]) if (settings.timeout > 0) abortTimeout = setTimeout(function(){