pixl-server-web 2.0.7 → 2.0.8
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.
- package/lib/request.js +17 -4
- package/package.json +1 -1
package/lib/request.js
CHANGED
|
@@ -564,11 +564,24 @@ module.exports = class Request {
|
|
|
564
564
|
}
|
|
565
565
|
else if (arguments[0] === true) {
|
|
566
566
|
// true means handler sent the raw response itself
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
567
|
+
args.resp_headers = { ...args.response.getHeaders() };
|
|
568
|
+
|
|
569
|
+
if (args.request.socket.destroyed) {
|
|
570
|
+
args.http_code = 0;
|
|
571
|
+
args.http_status = 'Socket Closed';
|
|
572
|
+
self.logDebug(9, "Socket closed during custom response");
|
|
571
573
|
}
|
|
574
|
+
else {
|
|
575
|
+
args.http_code = args.response.statusCode || 0;
|
|
576
|
+
args.http_status = args.response.statusMessage || '';
|
|
577
|
+
self.logDebug(9, "Handler sent custom response", {
|
|
578
|
+
statusCode: args.http_code,
|
|
579
|
+
statusMessage: args.http_status,
|
|
580
|
+
headers: args.resp_headers
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
self.finishRequest(args);
|
|
572
585
|
}
|
|
573
586
|
else if (arguments[0] === false) {
|
|
574
587
|
// false means handler did nothing, fall back to static
|
package/package.json
CHANGED