miqro 7.0.5 → 7.0.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.
|
@@ -69,7 +69,7 @@ async function main() {
|
|
|
69
69
|
cache,
|
|
70
70
|
localCache,
|
|
71
71
|
loggerProvider,
|
|
72
|
-
|
|
72
|
+
webSocketManager,
|
|
73
73
|
logger: loggerProvider.getLogger("server"),
|
|
74
74
|
dbManager,
|
|
75
75
|
port: PORT
|
|
@@ -77,6 +77,8 @@ async function main() {
|
|
|
77
77
|
|
|
78
78
|
await Promise.all([${DBCONFIGLIST}]);
|
|
79
79
|
|
|
80
|
+
${SERVERCONFIGLIST ? `\n await Promise.all([${SERVERCONFIGLIST}].filter(config=>config.preload).map(config=>config.preload(serverInterface)));\n` : ""}
|
|
81
|
+
|
|
80
82
|
${!WSLIST ? "" : `\n webSocketManager.replaceALLWS(await Promise.all([${WSLIST}]))`}
|
|
81
83
|
const app = new App({
|
|
82
84
|
onUpgrade: (req, socket, head) => {
|
|
@@ -88,7 +90,7 @@ async function main() {
|
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
});
|
|
91
|
-
|
|
93
|
+
|
|
92
94
|
app.use(ServerRequestHandler(serverInterface));
|
|
93
95
|
app.use(LoggerHandler());
|
|
94
96
|
${services.map(service => `app.use(await (await require("./${join(service, "router.cjs")}")).setupRouter());`).join("\n")}
|
package/build/lib.cjs
CHANGED
|
@@ -2813,7 +2813,7 @@ var init_websocket = __esm({
|
|
|
2813
2813
|
async onUpgrade(req, socket, head) {
|
|
2814
2814
|
const acceptKey = req.headers["sec-websocket-key"];
|
|
2815
2815
|
req.logger.debug("validating with acceptKey [%s]", acceptKey);
|
|
2816
|
-
if (!socket || (!req.headers.connection || req.headers.connection.indexOf("
|
|
2816
|
+
if (!socket || (!req.headers.connection || String(req.headers.connection).toLocaleLowerCase().indexOf("upgrade") === -1) || String(req.headers.upgrade).toLocaleLowerCase() !== "websocket" || String(req.method).toUpperCase() !== "GET" || !acceptKey) {
|
|
2817
2817
|
req.logger.warn("bad request");
|
|
2818
2818
|
socket.end("HTTP/1.1 400 Bad Request");
|
|
2819
2819
|
socket.destroy();
|
|
@@ -13084,7 +13084,7 @@ async function main() {
|
|
|
13084
13084
|
cache,
|
|
13085
13085
|
localCache,
|
|
13086
13086
|
loggerProvider,
|
|
13087
|
-
|
|
13087
|
+
webSocketManager,
|
|
13088
13088
|
logger: loggerProvider.getLogger("server"),
|
|
13089
13089
|
dbManager,
|
|
13090
13090
|
port: PORT
|
|
@@ -13092,6 +13092,10 @@ async function main() {
|
|
|
13092
13092
|
|
|
13093
13093
|
await Promise.all([${DBCONFIGLIST}]);
|
|
13094
13094
|
|
|
13095
|
+
${SERVERCONFIGLIST ? `
|
|
13096
|
+
await Promise.all([${SERVERCONFIGLIST}].filter(config=>config.preload).map(config=>config.preload(serverInterface)));
|
|
13097
|
+
` : ""}
|
|
13098
|
+
|
|
13095
13099
|
${!WSLIST ? "" : `
|
|
13096
13100
|
webSocketManager.replaceALLWS(await Promise.all([${WSLIST}]))`}
|
|
13097
13101
|
const app = new App({
|
|
@@ -13104,9 +13108,7 @@ async function main() {
|
|
|
13104
13108
|
}
|
|
13105
13109
|
}
|
|
13106
13110
|
});
|
|
13107
|
-
|
|
13108
|
-
await Promise.all([${SERVERCONFIGLIST}].filter(config=>config.preload).map(config=>config.preload(serverInterface)));
|
|
13109
|
-
` : ""}
|
|
13111
|
+
|
|
13110
13112
|
app.use(ServerRequestHandler(serverInterface));
|
|
13111
13113
|
app.use(LoggerHandler());
|
|
13112
13114
|
${services.map((service) => `app.use(await (await require("./${(0, import_node_path14.join)(service, "router.cjs")}")).setupRouter());`).join("\n")}
|