ismx-nexo-node-app 0.4.52 → 0.4.54
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.
|
@@ -46,7 +46,7 @@ class BusinessProxy {
|
|
|
46
46
|
}
|
|
47
47
|
call(tag, method, endpoint, request) {
|
|
48
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
var _a, _b
|
|
49
|
+
var _a, _b;
|
|
50
50
|
let module = this.modules[tag];
|
|
51
51
|
if (!module)
|
|
52
52
|
throw new Error(`Module ${tag} does not exist`);
|
|
@@ -57,8 +57,8 @@ class BusinessProxy {
|
|
|
57
57
|
for (const header of Object.keys(headers))
|
|
58
58
|
headers.set(header, (_b = (_a = request.headers) === null || _a === void 0 ? void 0 : _a[header]) !== null && _b !== void 0 ? _b : "");
|
|
59
59
|
// Si el body especificado es un objeto, lo convierte a JSON.
|
|
60
|
-
let body =
|
|
61
|
-
if (request.body && typeof request.body !== 'string') {
|
|
60
|
+
let body = request.body;
|
|
61
|
+
if (request.body && typeof request.body !== 'string' && !Buffer.isBuffer(request.body)) {
|
|
62
62
|
headers.set('Content-Type', 'application/json');
|
|
63
63
|
body = JSON.stringify(request.body);
|
|
64
64
|
}
|
package/package.json
CHANGED
|
@@ -29,8 +29,8 @@ export default class BusinessProxy
|
|
|
29
29
|
headers.set(header, request.headers?.[header] ?? "");
|
|
30
30
|
|
|
31
31
|
// Si el body especificado es un objeto, lo convierte a JSON.
|
|
32
|
-
let body: string | undefined = request.body
|
|
33
|
-
if (request.body && typeof request.body !== 'string') {
|
|
32
|
+
let body: string | undefined = request.body as string;
|
|
33
|
+
if (request.body && typeof request.body !== 'string' && !Buffer.isBuffer(request.body)) {
|
|
34
34
|
headers.set('Content-Type', 'application/json');
|
|
35
35
|
body = JSON.stringify(request.body);
|
|
36
36
|
}
|