Skip to content

Commit

Permalink
Merge pull request #195 from vandosant/master
Browse files Browse the repository at this point in the history
Fixing #184 Content type removed if data is false
  • Loading branch information
mzabriskie committed Jan 18, 2016
2 parents 20e724a + 71aadd6 commit dea613a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/adapters/xhr.js
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion test/specs/headers.spec.js
Expand Up @@ -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',
Expand Down

0 comments on commit dea613a

Please sign in to comment.