ismx-nexo-node-app 0.4.42 → 0.4.43
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.
|
@@ -71,8 +71,12 @@ class BusinessProxy {
|
|
|
71
71
|
catch (error) {
|
|
72
72
|
throw new Error(`Module ${tag} is not responding`);
|
|
73
73
|
}
|
|
74
|
-
if (response.ok)
|
|
75
|
-
|
|
74
|
+
if (response.ok) {
|
|
75
|
+
if (response.headers.get('Content-Type') === 'application/json')
|
|
76
|
+
return yield response.json();
|
|
77
|
+
else
|
|
78
|
+
return yield response.text();
|
|
79
|
+
}
|
|
76
80
|
else
|
|
77
81
|
throw yield response.json();
|
|
78
82
|
});
|
package/package.json
CHANGED
|
@@ -42,7 +42,10 @@ export default class BusinessProxy
|
|
|
42
42
|
});
|
|
43
43
|
} catch (error) { throw new Error(`Module ${tag} is not responding`); }
|
|
44
44
|
|
|
45
|
-
if (response.ok)
|
|
45
|
+
if (response.ok) {
|
|
46
|
+
if (response.headers.get('Content-Type') === 'application/json') return await response.json();
|
|
47
|
+
else return await response.text() as Res;
|
|
48
|
+
}
|
|
46
49
|
else throw await response.json();
|
|
47
50
|
}
|
|
48
51
|
|