2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

fix(headers): fixed common Content-Type header merging; (#5832)

This commit is contained in:
Dmitriy Mozgovoy
2023-08-26 16:26:50 +03:00
committed by GitHub
parent d8b4ca0ea5
commit 8fda2766b1
4 changed files with 33 additions and 23 deletions
+2 -4
View File
@@ -73,15 +73,13 @@ class Axios {
// Set config.method
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
let contextHeaders;
// Flatten headers
contextHeaders = headers && utils.merge(
let contextHeaders = headers && utils.merge(
headers.common,
headers[config.method]
);
contextHeaders && utils.forEach(
headers && utils.forEach(
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
(method) => {
delete headers[method];