intelicoreact 1.3.82 → 1.3.83
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.
|
@@ -92,6 +92,7 @@ class ApiUtils extends _Utils.default {
|
|
|
92
92
|
async getResponseBody(response, getBodyAs) {
|
|
93
93
|
if (!(response instanceof Response)) return response;
|
|
94
94
|
const contentType = response.headers.get("content-type");
|
|
95
|
+
if (!contentType) return "";
|
|
95
96
|
const executor = (() => {
|
|
96
97
|
if (typeof getBodyAs === 'string' && getBodyAs in response && typeof response[getBodyAs] === 'function') {
|
|
97
98
|
return response[getBodyAs];
|
|
@@ -99,8 +100,7 @@ class ApiUtils extends _Utils.default {
|
|
|
99
100
|
if (contentType !== null && contentType !== void 0 && contentType.includes('text/csv')) {
|
|
100
101
|
return response.blob;
|
|
101
102
|
}
|
|
102
|
-
if (contentType
|
|
103
|
-
return response.text;
|
|
103
|
+
if (contentType) return contentType.includes("json") ? response.json : response.text;
|
|
104
104
|
})();
|
|
105
105
|
|
|
106
106
|
// обработка случаев краша метода json при отсутствии тела ответа
|