ismx-nexo-node-app 0.4.51 → 0.4.53
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.
|
@@ -58,7 +58,7 @@ class BusinessProxy {
|
|
|
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
60
|
let body = (_c = request.body) === null || _c === void 0 ? void 0 : _c.toString();
|
|
61
|
-
if (request.body && typeof request.body !== 'string') {
|
|
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
|
}
|
|
@@ -49,7 +49,7 @@ class BusinessServer extends Business_1.default {
|
|
|
49
49
|
yield Promise.resolve().then(() => __importStar(require("cors"))).then((_a) => __awaiter(this, [_a], void 0, function* ({ default: cors }) {
|
|
50
50
|
this.express = express;
|
|
51
51
|
this.app = express();
|
|
52
|
-
|
|
52
|
+
this.app.use(express.urlencoded({ extended: false }));
|
|
53
53
|
this.app.use(cors());
|
|
54
54
|
}));
|
|
55
55
|
}));
|
|
@@ -83,7 +83,7 @@ class BusinessServer extends Business_1.default {
|
|
|
83
83
|
case 'xml': return this.express.xml();
|
|
84
84
|
case 'stream': return this.express.raw({ type: 'application/octet-stream', limit: '10mb' });
|
|
85
85
|
case 'image': return this.express.raw({ type: 'image/*', limit: '10mb' });
|
|
86
|
-
case '*': return this.express.raw({ limit: '10mb' });
|
|
86
|
+
case '*': return this.express.raw({ type: () => true, limit: '10mb' });
|
|
87
87
|
default: return this.express.json();
|
|
88
88
|
}
|
|
89
89
|
})();
|
package/package.json
CHANGED
|
@@ -30,7 +30,7 @@ export default class BusinessProxy
|
|
|
30
30
|
|
|
31
31
|
// Si el body especificado es un objeto, lo convierte a JSON.
|
|
32
32
|
let body: string | undefined = request.body?.toString();
|
|
33
|
-
if (request.body && typeof request.body !== '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
|
}
|
|
@@ -19,7 +19,7 @@ export default class BusinessServer extends Business
|
|
|
19
19
|
await import("cors").then(async ({ default: cors }) => {
|
|
20
20
|
this.express = express;
|
|
21
21
|
this.app = express();
|
|
22
|
-
|
|
22
|
+
this.app.use(express.urlencoded({ extended: false }));
|
|
23
23
|
this.app.use(cors());
|
|
24
24
|
})
|
|
25
25
|
});
|
|
@@ -65,7 +65,7 @@ export default class BusinessServer extends Business
|
|
|
65
65
|
case 'xml': return this.express.xml();
|
|
66
66
|
case 'stream': return this.express.raw({ type: 'application/octet-stream', limit: '10mb' });
|
|
67
67
|
case 'image': return this.express.raw({ type: 'image/*', limit: '10mb' });
|
|
68
|
-
case '*': return this.express.raw({ limit: '10mb' });
|
|
68
|
+
case '*': return this.express.raw({ type: () => true, limit: '10mb' });
|
|
69
69
|
default: return this.express.json();
|
|
70
70
|
}})();
|
|
71
71
|
|