mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
This reverts commit 920510b3a6.
This commit is contained in:
@@ -43,9 +43,7 @@ module.exports = function dispatchRequest(config) {
|
|||||||
utils.forEach(
|
utils.forEach(
|
||||||
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
||||||
function cleanHeaderConfig(method) {
|
function cleanHeaderConfig(method) {
|
||||||
if (typeof config.headers[method] !== 'string') {
|
delete config.headers[method];
|
||||||
delete config.headers[method];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -86,17 +86,4 @@ describe('headers', function () {
|
|||||||
done();
|
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();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user