ismx-nexo-node-app 0.4.41 → 0.4.42
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.
|
@@ -109,7 +109,7 @@ class BusinessServer extends Business_1.default {
|
|
|
109
109
|
}
|
|
110
110
|
run(service) {
|
|
111
111
|
return (request, socket) => __awaiter(this, void 0, void 0, function* () {
|
|
112
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
112
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
113
113
|
let code;
|
|
114
114
|
let response = Service_1.HttpResponse.ko(500, "Internal server error");
|
|
115
115
|
// Asigna un valor único a la llamada de la API.
|
|
@@ -141,10 +141,13 @@ class BusinessServer extends Business_1.default {
|
|
|
141
141
|
response = Service_1.HttpResponse.ko(500, null);
|
|
142
142
|
}
|
|
143
143
|
finally {
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
socket.status((_g = response === null || response === void 0 ? void 0 : response.httpCode) !== null && _g !== void 0 ? _g : 500);
|
|
145
|
+
Object.entries((_h = response.headers) !== null && _h !== void 0 ? _h : {}).forEach(([header, value]) => {
|
|
146
|
+
socket.set(header, value);
|
|
147
|
+
});
|
|
148
|
+
socket.send(response === null || response === void 0 ? void 0 : response.content);
|
|
146
149
|
try {
|
|
147
|
-
(
|
|
150
|
+
(_j = this.onEnd) === null || _j === void 0 ? void 0 : _j.call(this, request, response);
|
|
148
151
|
}
|
|
149
152
|
catch (e) { }
|
|
150
153
|
}
|
package/package.json
CHANGED
|
@@ -103,8 +103,11 @@ export default class BusinessServer extends Business
|
|
|
103
103
|
else response = HttpResponse.ko(500, null);
|
|
104
104
|
|
|
105
105
|
} finally {
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
socket.status(response?.httpCode ?? 500)
|
|
107
|
+
Object.entries(response.headers ?? {}).forEach(([header, value]) => {
|
|
108
|
+
socket.set(header, value);
|
|
109
|
+
});
|
|
110
|
+
socket.send(response?.content);
|
|
108
111
|
try { this.onEnd?.(request, response); } catch(e) { }
|
|
109
112
|
}
|
|
110
113
|
}}
|