isite 2024.12.4 → 2024.12.6
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/mongodb.js +5 -0
- package/lib/routing.js +5 -5
- package/package.json +1 -1
package/lib/mongodb.js
CHANGED
|
@@ -66,6 +66,10 @@ module.exports = function init(____0) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
if (typeof doc === 'object') {
|
|
69
|
+
|
|
70
|
+
delete doc.$req;
|
|
71
|
+
delete doc.$res;
|
|
72
|
+
|
|
69
73
|
if ($badLetter) {
|
|
70
74
|
doc = ____0.removeRefObject(doc);
|
|
71
75
|
}
|
|
@@ -75,6 +79,7 @@ module.exports = function init(____0) {
|
|
|
75
79
|
if (typeof doc[key] === 'string') {
|
|
76
80
|
doc[key] = _mongo.ObjectID(doc[key]);
|
|
77
81
|
}
|
|
82
|
+
} else if (key === 'id') {
|
|
78
83
|
} else if (typeof key === 'string' && $badLetter && key.indexOf($badLetter) === 0) {
|
|
79
84
|
delete doc[key];
|
|
80
85
|
} else if (Array.isArray(doc[key])) {
|
package/lib/routing.js
CHANGED
|
@@ -765,15 +765,15 @@ module.exports = function init(____0) {
|
|
|
765
765
|
};
|
|
766
766
|
|
|
767
767
|
res.code = null;
|
|
768
|
-
req.
|
|
768
|
+
req.remoteAddress = req.socket?.remoteAddress || '';
|
|
769
769
|
req.acceptEncoding = req.headers[____0.strings[5]] ? req.headers[____0.strings[5]] : '';
|
|
770
|
-
res.ip = req.ip = req.headers[____0.strings[6]] ? req.headers[____0.strings[6]] : req.
|
|
770
|
+
res.ip = req.ip = req.headers[____0.strings[6]] ? req.headers[____0.strings[6]] : req.remoteAddress?.replace('::ffff:', '');
|
|
771
771
|
if (req.ip == '::1') {
|
|
772
772
|
req.ip = '127.0.0.1';
|
|
773
773
|
}
|
|
774
|
-
res.ip2 = req.ip2 = req.socket
|
|
775
|
-
res.port = req.port = req.socket
|
|
776
|
-
res.port2 = req.port2 = req.socket
|
|
774
|
+
res.ip2 = req.ip2 = req.socket?.localAddress.replace('::ffff:', '');
|
|
775
|
+
res.port = req.port = req.socket?.remotePort;
|
|
776
|
+
res.port2 = req.port2 = req.socket?.localPort;
|
|
777
777
|
res.cookies = res.cookie = req.cookies = req.cookie = ____0.cookie(req, res, ____0);
|
|
778
778
|
|
|
779
779
|
req.urlRaw = req.url;
|