geonix 1.23.5 → 1.23.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geonix",
3
- "version": "1.23.5",
3
+ "version": "1.23.6",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "bin": {
@@ -31,4 +31,4 @@
31
31
  "eslint": "^9.36.0",
32
32
  "typescript": "^5.5.4"
33
33
  }
34
- }
34
+ }
package/src/Gateway.js CHANGED
@@ -10,8 +10,6 @@ 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: "1024mb" });
14
-
15
13
  const DEBUG_ENDPOINT = "/lZ6jD2eC3iP0zB3jJ1yJ9pM8gG3yI3vS";
16
14
  const endpointMatcher = /^((?<options>.+)\|)?(?<verb>WS|GET|POST|PATCH|PUT|DELETE|HEAD|OPTIONS|ALL)\s(?<url>.*)/;
17
15
 
@@ -99,7 +97,7 @@ export class Gateway {
99
97
  });
100
98
 
101
99
  // handle mapped endpoints as service calls
102
- this.#api.use(raw, (req, res, next) => {
100
+ this.#api.use((req, res, next) => {
103
101
  stats.requests++;
104
102
 
105
103
  if (this.#router) {
package/test/upload.js CHANGED
@@ -6,14 +6,25 @@ import { writeFile } from "fs/promises";
6
6
  class UploadService extends Service {
7
7
 
8
8
  async "POST /upload"(req, res) {
9
- const files = await parseMultipart(req, { useMemory: false });
9
+ console.log(req.body);
10
+ let size = 0;
10
11
 
11
- for (const file of files) {
12
- file.body = await streamToBuffer(file.body);
13
- console.log(`${file.filename} ${file.headers["content-type"]} size=${file.body.length}`);
12
+ req.on("data", (chunk) => {
13
+ console.log(`size=${size}`);
14
+ size += chunk.length;
15
+ });
16
+ req.on("end", () => {
17
+ console.log(`size=${size}`);
18
+ });
14
19
 
15
- await writeFile("/tmp/temp.pdf", file.body);
16
- }
20
+ // const files = await parseMultipart(req, { useMemory: false });
21
+
22
+ // for (const file of files) {
23
+ // file.body = await streamToBuffer(file.body);
24
+ // console.log(`${file.filename} ${file.headers["content-type"]} size=${file.body.length}`);
25
+
26
+ // await writeFile("/tmp/temp.pdf", file.body);
27
+ // }
17
28
 
18
29
  res.send("ok");
19
30
  }