2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-02 16:04:10 +03:00

Fixing #184 Content type removed if data is false

This commit is contained in:
vandosant
2016-01-17 21:25:21 -07:00
parent 20e724af80
commit 71aadd604d
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',