geonix 1.23.0 → 1.23.1
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/package.json +1 -1
- package/src/Gateway.js +1 -1
- package/src/Service.js +2 -2
- package/src/WebServer.js +11 -5
- package/test/big_upload.js +0 -0
- package/test/gateway.js +12 -4
package/package.json
CHANGED
package/src/Gateway.js
CHANGED
|
@@ -10,7 +10,7 @@ import semver from "semver";
|
|
|
10
10
|
import { WebSocket } from "ws";
|
|
11
11
|
import { logger } from "./Logger.js";
|
|
12
12
|
|
|
13
|
-
const raw = express.raw({ limit: "
|
|
13
|
+
const raw = express.raw({ limit: "1024mb" });
|
|
14
14
|
|
|
15
15
|
const DEBUG_ENDPOINT = "/lZ6jD2eC3iP0zB3jJ1yJ9pM8gG3yI3vS";
|
|
16
16
|
const endpointMatcher = /^((?<options>.+)\|)?(?<verb>WS|GET|POST|PATCH|PUT|DELETE|HEAD|OPTIONS|ALL)\s(?<url>.*)/;
|
package/src/Service.js
CHANGED
|
@@ -15,8 +15,8 @@ const isEndpointFilter = methodName => endpointMatcher.test(methodName);
|
|
|
15
15
|
const ERROR_BEGIN_DELIMITER = "-".repeat(10);
|
|
16
16
|
const ERROR_END_DELIMITER = "-".repeat(40);
|
|
17
17
|
|
|
18
|
-
const json = express.json({ limit: "
|
|
19
|
-
const raw = express.raw({ type: "*/*", limit: "
|
|
18
|
+
const json = express.json({ limit: "1024mb" });
|
|
19
|
+
const raw = express.raw({ type: "*/*", limit: "1024mb" });
|
|
20
20
|
const cookies = cookieParser();
|
|
21
21
|
|
|
22
22
|
/**
|
package/src/WebServer.js
CHANGED
|
@@ -103,12 +103,18 @@ class WebServer {
|
|
|
103
103
|
|
|
104
104
|
let router = routers.shift();
|
|
105
105
|
while (router) {
|
|
106
|
-
router = await new Promise((resolve) => {
|
|
106
|
+
router = await new Promise((resolve, reject) => {
|
|
107
107
|
currentResolve = resolve;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
|
|
109
|
+
router(req, res,
|
|
110
|
+
(error, _req, _res, _next) => {
|
|
111
|
+
if (error) {
|
|
112
|
+
return reject(error);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// go to next router
|
|
116
|
+
resolve(routers.shift());
|
|
117
|
+
});
|
|
112
118
|
});
|
|
113
119
|
}
|
|
114
120
|
|
|
File without changes
|
package/test/gateway.js
CHANGED
|
@@ -8,13 +8,21 @@ class TestService extends Service {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
async "POST /upload"(req, res) {
|
|
11
|
-
|
|
11
|
+
try {
|
|
12
|
+
const parts = await parseMultipart(req, { useMemory: false });
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
for (const part of parts) {
|
|
15
|
+
console.debug(part?.body);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
res.send("OK");
|
|
19
|
+
} catch (e) {
|
|
20
|
+
console.error(e);
|
|
15
21
|
}
|
|
22
|
+
}
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
"GET /test"(req, res) {
|
|
25
|
+
res.send("Hello World - /test");
|
|
18
26
|
}
|
|
19
27
|
|
|
20
28
|
}
|