h3 1.15.4 → 1.15.5
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/index.cjs +13 -6
- package/dist/index.mjs +13 -6
- package/package.json +28 -25
package/dist/index.cjs
CHANGED
|
@@ -418,7 +418,9 @@ function readRawBody(event, encoding = "utf8") {
|
|
|
418
418
|
});
|
|
419
419
|
return encoding ? promise2.then((buff) => buff.toString(encoding)) : promise2;
|
|
420
420
|
}
|
|
421
|
-
if (!Number.parseInt(event.node.req.headers["content-length"] || "") &&
|
|
421
|
+
if (!Number.parseInt(event.node.req.headers["content-length"] || "") && !/\bchunked\b/i.test(
|
|
422
|
+
String(event.node.req.headers["transfer-encoding"] ?? "")
|
|
423
|
+
)) {
|
|
422
424
|
return Promise.resolve(void 0);
|
|
423
425
|
}
|
|
424
426
|
const promise = event.node.req[RawBodySymbol] = new Promise(
|
|
@@ -1440,11 +1442,16 @@ async function updateSession(event, config, update) {
|
|
|
1440
1442
|
async function sealSession(event, config) {
|
|
1441
1443
|
const sessionName = config.name || DEFAULT_NAME;
|
|
1442
1444
|
const session = event.context.sessions?.[sessionName] || await getSession(event, config);
|
|
1443
|
-
const sealed = await ironWebcrypto.seal(
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1445
|
+
const sealed = await ironWebcrypto.seal(
|
|
1446
|
+
config.crypto || crypto__default,
|
|
1447
|
+
session,
|
|
1448
|
+
config.password,
|
|
1449
|
+
{
|
|
1450
|
+
...ironWebcrypto.defaults,
|
|
1451
|
+
ttl: config.maxAge ? config.maxAge * 1e3 : 0,
|
|
1452
|
+
...config.seal
|
|
1453
|
+
}
|
|
1454
|
+
);
|
|
1448
1455
|
return sealed;
|
|
1449
1456
|
}
|
|
1450
1457
|
async function unsealSession(_event, config, sealed) {
|
package/dist/index.mjs
CHANGED
|
@@ -411,7 +411,9 @@ function readRawBody(event, encoding = "utf8") {
|
|
|
411
411
|
});
|
|
412
412
|
return encoding ? promise2.then((buff) => buff.toString(encoding)) : promise2;
|
|
413
413
|
}
|
|
414
|
-
if (!Number.parseInt(event.node.req.headers["content-length"] || "") &&
|
|
414
|
+
if (!Number.parseInt(event.node.req.headers["content-length"] || "") && !/\bchunked\b/i.test(
|
|
415
|
+
String(event.node.req.headers["transfer-encoding"] ?? "")
|
|
416
|
+
)) {
|
|
415
417
|
return Promise.resolve(void 0);
|
|
416
418
|
}
|
|
417
419
|
const promise = event.node.req[RawBodySymbol] = new Promise(
|
|
@@ -1433,11 +1435,16 @@ async function updateSession(event, config, update) {
|
|
|
1433
1435
|
async function sealSession(event, config) {
|
|
1434
1436
|
const sessionName = config.name || DEFAULT_NAME;
|
|
1435
1437
|
const session = event.context.sessions?.[sessionName] || await getSession(event, config);
|
|
1436
|
-
const sealed = await seal(
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1438
|
+
const sealed = await seal(
|
|
1439
|
+
config.crypto || crypto,
|
|
1440
|
+
session,
|
|
1441
|
+
config.password,
|
|
1442
|
+
{
|
|
1443
|
+
...defaults,
|
|
1444
|
+
ttl: config.maxAge ? config.maxAge * 1e3 : 0,
|
|
1445
|
+
...config.seal
|
|
1446
|
+
}
|
|
1447
|
+
);
|
|
1441
1448
|
return sealed;
|
|
1442
1449
|
}
|
|
1443
1450
|
async function unsealSession(_event, config, sealed) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "h3",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.5",
|
|
4
4
|
"description": "Minimal H(TTP) framework built for high performance and portability.",
|
|
5
5
|
"repository": "h3js/h3",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,10 +24,12 @@
|
|
|
24
24
|
"dev": "vitest",
|
|
25
25
|
"lint": "eslint --cache . && prettier -c src test playground examples docs",
|
|
26
26
|
"lint:fix": "eslint --cache . --fix && prettier -c src test playground examples docs -w",
|
|
27
|
+
"prepack": "pnpm build",
|
|
27
28
|
"play": "listhen -w ./playground/app.ts",
|
|
28
29
|
"profile": "0x -o -D .profile -P 'autocannon -c 100 -p 10 -d 40 http://localhost:$PORT' ./playground/server.cjs",
|
|
29
|
-
"release": "pnpm test && pnpm build && changelogen --release --publish --publishTag
|
|
30
|
-
"test": "pnpm lint && vitest --run --coverage"
|
|
30
|
+
"release": "pnpm test && pnpm build && changelogen --release --publish --publishTag 1x && git push --follow-tags",
|
|
31
|
+
"test": "pnpm lint && vitest --run --coverage && pnpm test:types",
|
|
32
|
+
"test:types": "tsgo --noEmit"
|
|
31
33
|
},
|
|
32
34
|
"resolutions": {
|
|
33
35
|
"h3": "^1.14.0"
|
|
@@ -38,38 +40,39 @@
|
|
|
38
40
|
"defu": "^6.1.4",
|
|
39
41
|
"destr": "^2.0.5",
|
|
40
42
|
"iron-webcrypto": "^1.2.1",
|
|
41
|
-
"node-mock-http": "^1.0.
|
|
43
|
+
"node-mock-http": "^1.0.4",
|
|
42
44
|
"radix3": "^1.1.2",
|
|
43
|
-
"ufo": "^1.6.
|
|
45
|
+
"ufo": "^1.6.3",
|
|
44
46
|
"uncrypto": "^0.1.3"
|
|
45
47
|
},
|
|
46
48
|
"devDependencies": {
|
|
47
49
|
"0x": "^6.0.0",
|
|
48
|
-
"@types/express": "^5.0.
|
|
49
|
-
"@types/node": "^
|
|
50
|
+
"@types/express": "^5.0.6",
|
|
51
|
+
"@types/node": "^25.0.8",
|
|
50
52
|
"@types/supertest": "^6.0.3",
|
|
51
|
-
"@
|
|
53
|
+
"@typescript/native-preview": "7.0.0-dev.20260115.1",
|
|
54
|
+
"@vitest/coverage-v8": "^4.0.17",
|
|
52
55
|
"autocannon": "^8.0.0",
|
|
53
|
-
"automd": "^0.4.
|
|
56
|
+
"automd": "^0.4.2",
|
|
54
57
|
"changelogen": "^0.6.2",
|
|
55
58
|
"connect": "^3.7.0",
|
|
56
|
-
"eslint": "^9.
|
|
57
|
-
"eslint-config-unjs": "^0.
|
|
58
|
-
"express": "^5.1
|
|
59
|
+
"eslint": "^9.39.2",
|
|
60
|
+
"eslint-config-unjs": "^0.6.2",
|
|
61
|
+
"express": "^5.2.1",
|
|
59
62
|
"get-port": "^7.1.0",
|
|
60
|
-
"h3": "^1.
|
|
61
|
-
"jiti": "^2.
|
|
63
|
+
"h3": "^2.0.1-rc.8",
|
|
64
|
+
"jiti": "^2.6.1",
|
|
62
65
|
"listhen": "^1.9.0",
|
|
63
|
-
"node-fetch-native": "^1.6.
|
|
64
|
-
"prettier": "^3.
|
|
65
|
-
"react": "^19.
|
|
66
|
-
"react-dom": "^19.
|
|
67
|
-
"supertest": "^7.
|
|
68
|
-
"typescript": "^5.
|
|
69
|
-
"unbuild": "^3.6.
|
|
70
|
-
"undici": "^7.
|
|
71
|
-
"vitest": "^
|
|
72
|
-
"zod": "^4.
|
|
66
|
+
"node-fetch-native": "^1.6.7",
|
|
67
|
+
"prettier": "^3.8.0",
|
|
68
|
+
"react": "^19.2.3",
|
|
69
|
+
"react-dom": "^19.2.3",
|
|
70
|
+
"supertest": "^7.2.2",
|
|
71
|
+
"typescript": "^5.9.3",
|
|
72
|
+
"unbuild": "^3.6.1",
|
|
73
|
+
"undici": "^7.18.2",
|
|
74
|
+
"vitest": "^4.0.17",
|
|
75
|
+
"zod": "^4.3.5"
|
|
73
76
|
},
|
|
74
|
-
"packageManager": "pnpm@10.
|
|
77
|
+
"packageManager": "pnpm@10.28.0"
|
|
75
78
|
}
|