diff --git a/lib/core/dispatchRequest.js b/lib/core/dispatchRequest.js index 7768e00..c8267ad 100644 --- a/lib/core/dispatchRequest.js +++ b/lib/core/dispatchRequest.js @@ -43,9 +43,7 @@ module.exports = function dispatchRequest(config) { utils.forEach( ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function cleanHeaderConfig(method) { - if (typeof config.headers[method] !== 'string') { - delete config.headers[method]; - } + delete config.headers[method]; } ); diff --git a/test/specs/headers.spec.js b/test/specs/headers.spec.js index 6c2aba3..5a8b1a8 100644 --- a/test/specs/headers.spec.js +++ b/test/specs/headers.spec.js @@ -86,17 +86,4 @@ describe('headers', function () { done(); }); }); - - describe('when a header key matches an HTTP verb', function() { - it('preserves the header value', function(done) { - axios.post('/foo', null, { 'headers': { 'delete': 'test' } }); - - getAjaxRequest().then(function (request) { - var headerValue = request.requestHeaders['delete']; - - expect(headerValue).toEqual('test'); - done(); - }); - }); - }); });