ag-common 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,7 +24,7 @@ const axiosHelper = ({ verb, url, body, headers, timeout = 30000, retryMax = 0,
|
|
|
24
24
|
let retry = 0;
|
|
25
25
|
do {
|
|
26
26
|
try {
|
|
27
|
-
const setHeaders = Object.assign({
|
|
27
|
+
const setHeaders = Object.assign({ Accept: 'application/json' }, headers);
|
|
28
28
|
if (verb === 'get') {
|
|
29
29
|
const ret = yield axios_1.default.get(url, {
|
|
30
30
|
headers: setHeaders,
|
|
@@ -60,7 +60,8 @@ const axiosHelper = ({ verb, url, body, headers, timeout = 30000, retryMax = 0,
|
|
|
60
60
|
else {
|
|
61
61
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
62
62
|
if (body && (0, object_1.isJson)(body)) {
|
|
63
|
-
setHeaders['Content-Type'] =
|
|
63
|
+
setHeaders['Content-Type'] =
|
|
64
|
+
setHeaders['Content-Type'] || 'application/json';
|
|
64
65
|
}
|
|
65
66
|
ret = yield axios(url, body, { headers: setHeaders });
|
|
66
67
|
}
|