2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-21 13:24:11 +03:00

Merge pull request #195 from vandosant/master

Fixing #184 Content type removed if data is false
This commit is contained in:
Matt Zabriskie
2016-01-17 22:07:56 -07:00
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ module.exports = function xhrAdapter(resolve, reject, config) {
// Add headers to the request
if ('setRequestHeader' in request) {
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
if (!requestData && key.toLowerCase() === 'content-type') {
if ((requestData === undefined || requestData === null) && key.toLowerCase() === 'content-type') {
// Remove Content-Type if data is undefined
delete requestHeaders[key];
} else {
+1 -1
View File
@@ -99,7 +99,7 @@ describe('headers', function () {
}, 0);
});
xit('should preserve content-type if data is false', function (done) {
it('should preserve content-type if data is false', function (done) {
axios({
url: '/foo',
method: 'post',