@eggjs/koa 3.1.2-beta.17 → 3.1.2-beta.19

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/dist/request.js CHANGED
@@ -254,7 +254,8 @@ var Request = class {
254
254
  get length() {
255
255
  const len = this.get("Content-Length");
256
256
  if (len === "") return;
257
- return Number.parseInt(len);
257
+ const parsed = Number.parseInt(len, 10);
258
+ return Number.isNaN(parsed) ? void 0 : parsed;
258
259
  }
259
260
  /**
260
261
  * Return the protocol string "http" or "https"
package/dist/response.js CHANGED
@@ -134,7 +134,7 @@ var Response = class {
134
134
  * When Content-Length is not defined it will return `undefined`.
135
135
  */
136
136
  get length() {
137
- if (this.has("Content-Length")) return Number.parseInt(this.get("Content-Length")) || 0;
137
+ if (this.has("Content-Length")) return Number.parseInt(this.get("Content-Length"), 10) || 0;
138
138
  const body = this.body;
139
139
  if (!body || body instanceof Stream) return;
140
140
  if (typeof body === "string") return Buffer.byteLength(body);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eggjs/koa",
3
- "version": "3.1.2-beta.17",
3
+ "version": "3.1.2-beta.19",
4
4
  "description": "Koa web app framework for https://eggjs.org",
5
5
  "keywords": [
6
6
  "app",
@@ -30,9 +30,17 @@
30
30
  "./package.json": "./package.json"
31
31
  },
32
32
  "publishConfig": {
33
- "access": "public"
33
+ "access": "public",
34
+ "exports": {
35
+ ".": "./dist/index.js",
36
+ "./package.json": "./package.json"
37
+ }
38
+ },
39
+ "scripts": {
40
+ "typecheck": "tsgo --noEmit"
34
41
  },
35
42
  "dependencies": {
43
+ "@eggjs/cookies": "4.0.2-beta.19",
36
44
  "@types/content-disposition": "^0.5.8",
37
45
  "accepts": "^1.3.8",
38
46
  "cache-content-type": "^2.0.0",
@@ -50,10 +58,10 @@
50
58
  "parseurl": "^1.3.3",
51
59
  "statuses": "^2.0.1",
52
60
  "type-is": "^2.0.0",
53
- "vary": "^1.1.2",
54
- "@eggjs/cookies": "4.0.2-beta.17"
61
+ "vary": "^1.1.2"
55
62
  },
56
63
  "devDependencies": {
64
+ "@eggjs/supertest": "9.0.2-beta.19",
57
65
  "@types/accepts": "^1.3.7",
58
66
  "@types/content-type": "^1.1.8",
59
67
  "@types/destroy": "^1.0.3",
@@ -68,13 +76,9 @@
68
76
  "@types/type-is": "^1.6.6",
69
77
  "@types/vary": "^1.1.3",
70
78
  "mm": "^4.0.2",
71
- "typescript": "^5.9.3",
72
- "@eggjs/supertest": "9.0.2-beta.17"
79
+ "typescript": "^5.9.3"
73
80
  },
74
81
  "engines": {
75
82
  "node": ">=22.18.0"
76
- },
77
- "scripts": {
78
- "typecheck": "tsgo --noEmit"
79
83
  }
80
- }
84
+ }