Skip to content

Commit a963135

Browse files
committed
content-type casing error and axios upgrade regression
1 parent d0a70f4 commit a963135

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

lib/axiosInstance.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
const axios = require('axios').default;
22

3-
// Add workaround for axios formdata issue
4-
// Added transformRequest based on on issue resolution suggestion here:
5-
// https://github.com/axios/axios/issues/5986#issuecomment-2029933275
6-
const axiosInstance = axios.create({
7-
transformRequest: axios.defaults.transformRequest,
8-
transformResponse: axios.defaults.transformResponse,
9-
...axios.config,
10-
});
3+
const axiosInstance = axios.create({});
114

125
module.exports = axiosInstance;

lib/dispatchRequest.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ function DispatchRequest(url, action, payload, local_auth, remote_auth = null, c
215215
}
216216
default: {
217217
options.headers = options.headers ? options.headers : {};
218-
options.headers['Content-Type'] = 'application/json; charset=utf-8';
218+
if(!options.headers['content-type'] && !options.headers['Content-Type']) {
219+
options.headers['Content-Type'] = 'application/json; charset=utf-8';
220+
}
219221
const compressedContentPost = checkPayload(payload, options, compress);
220222
return axiosInstance
221223
.post(url, compressedContentPost || payload || {}, options)

0 commit comments

Comments
 (0)