@hono/node-server 1.18.1 → 1.18.2
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.js +25 -23
- package/dist/index.mjs +25 -23
- package/dist/listener.js +25 -23
- package/dist/listener.mjs +25 -23
- package/dist/server.js +25 -23
- package/dist/server.mjs +25 -23
- package/dist/vercel.js +25 -23
- package/dist/vercel.mjs +25 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -448,33 +448,35 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
448
448
|
const values = [];
|
|
449
449
|
let done = false;
|
|
450
450
|
let currentReadPromise = void 0;
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
if (
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
451
|
+
if (resHeaderRecord["transfer-encoding"] !== "chunked") {
|
|
452
|
+
let maxReadCount = 2;
|
|
453
|
+
for (let i = 0; i < maxReadCount; i++) {
|
|
454
|
+
currentReadPromise ||= reader.read();
|
|
455
|
+
const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {
|
|
456
|
+
console.error(e);
|
|
457
|
+
done = true;
|
|
458
|
+
});
|
|
459
|
+
if (!chunk) {
|
|
460
|
+
if (i === 1) {
|
|
461
|
+
await new Promise((resolve) => setTimeout(resolve));
|
|
462
|
+
maxReadCount = 3;
|
|
463
|
+
continue;
|
|
464
|
+
}
|
|
465
|
+
break;
|
|
466
|
+
}
|
|
467
|
+
currentReadPromise = void 0;
|
|
468
|
+
if (chunk.value) {
|
|
469
|
+
values.push(chunk.value);
|
|
470
|
+
}
|
|
471
|
+
if (chunk.done) {
|
|
472
|
+
done = true;
|
|
473
|
+
break;
|
|
463
474
|
}
|
|
464
|
-
break;
|
|
465
|
-
}
|
|
466
|
-
currentReadPromise = void 0;
|
|
467
|
-
if (chunk.value) {
|
|
468
|
-
values.push(chunk.value);
|
|
469
475
|
}
|
|
470
|
-
if (
|
|
471
|
-
|
|
472
|
-
break;
|
|
476
|
+
if (done && !("content-length" in resHeaderRecord)) {
|
|
477
|
+
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
473
478
|
}
|
|
474
479
|
}
|
|
475
|
-
if (done && !("content-length" in resHeaderRecord)) {
|
|
476
|
-
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
477
|
-
}
|
|
478
480
|
outgoing.writeHead(res.status, resHeaderRecord);
|
|
479
481
|
values.forEach((value) => {
|
|
480
482
|
;
|
package/dist/index.mjs
CHANGED
|
@@ -409,33 +409,35 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
409
409
|
const values = [];
|
|
410
410
|
let done = false;
|
|
411
411
|
let currentReadPromise = void 0;
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
if (
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
412
|
+
if (resHeaderRecord["transfer-encoding"] !== "chunked") {
|
|
413
|
+
let maxReadCount = 2;
|
|
414
|
+
for (let i = 0; i < maxReadCount; i++) {
|
|
415
|
+
currentReadPromise ||= reader.read();
|
|
416
|
+
const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {
|
|
417
|
+
console.error(e);
|
|
418
|
+
done = true;
|
|
419
|
+
});
|
|
420
|
+
if (!chunk) {
|
|
421
|
+
if (i === 1) {
|
|
422
|
+
await new Promise((resolve) => setTimeout(resolve));
|
|
423
|
+
maxReadCount = 3;
|
|
424
|
+
continue;
|
|
425
|
+
}
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
currentReadPromise = void 0;
|
|
429
|
+
if (chunk.value) {
|
|
430
|
+
values.push(chunk.value);
|
|
431
|
+
}
|
|
432
|
+
if (chunk.done) {
|
|
433
|
+
done = true;
|
|
434
|
+
break;
|
|
424
435
|
}
|
|
425
|
-
break;
|
|
426
|
-
}
|
|
427
|
-
currentReadPromise = void 0;
|
|
428
|
-
if (chunk.value) {
|
|
429
|
-
values.push(chunk.value);
|
|
430
436
|
}
|
|
431
|
-
if (
|
|
432
|
-
|
|
433
|
-
break;
|
|
437
|
+
if (done && !("content-length" in resHeaderRecord)) {
|
|
438
|
+
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
434
439
|
}
|
|
435
440
|
}
|
|
436
|
-
if (done && !("content-length" in resHeaderRecord)) {
|
|
437
|
-
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
438
|
-
}
|
|
439
441
|
outgoing.writeHead(res.status, resHeaderRecord);
|
|
440
442
|
values.forEach((value) => {
|
|
441
443
|
;
|
package/dist/listener.js
CHANGED
|
@@ -440,33 +440,35 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
440
440
|
const values = [];
|
|
441
441
|
let done = false;
|
|
442
442
|
let currentReadPromise = void 0;
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
if (
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
443
|
+
if (resHeaderRecord["transfer-encoding"] !== "chunked") {
|
|
444
|
+
let maxReadCount = 2;
|
|
445
|
+
for (let i = 0; i < maxReadCount; i++) {
|
|
446
|
+
currentReadPromise ||= reader.read();
|
|
447
|
+
const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {
|
|
448
|
+
console.error(e);
|
|
449
|
+
done = true;
|
|
450
|
+
});
|
|
451
|
+
if (!chunk) {
|
|
452
|
+
if (i === 1) {
|
|
453
|
+
await new Promise((resolve) => setTimeout(resolve));
|
|
454
|
+
maxReadCount = 3;
|
|
455
|
+
continue;
|
|
456
|
+
}
|
|
457
|
+
break;
|
|
458
|
+
}
|
|
459
|
+
currentReadPromise = void 0;
|
|
460
|
+
if (chunk.value) {
|
|
461
|
+
values.push(chunk.value);
|
|
462
|
+
}
|
|
463
|
+
if (chunk.done) {
|
|
464
|
+
done = true;
|
|
465
|
+
break;
|
|
455
466
|
}
|
|
456
|
-
break;
|
|
457
|
-
}
|
|
458
|
-
currentReadPromise = void 0;
|
|
459
|
-
if (chunk.value) {
|
|
460
|
-
values.push(chunk.value);
|
|
461
467
|
}
|
|
462
|
-
if (
|
|
463
|
-
|
|
464
|
-
break;
|
|
468
|
+
if (done && !("content-length" in resHeaderRecord)) {
|
|
469
|
+
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
465
470
|
}
|
|
466
471
|
}
|
|
467
|
-
if (done && !("content-length" in resHeaderRecord)) {
|
|
468
|
-
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
469
|
-
}
|
|
470
472
|
outgoing.writeHead(res.status, resHeaderRecord);
|
|
471
473
|
values.forEach((value) => {
|
|
472
474
|
;
|
package/dist/listener.mjs
CHANGED
|
@@ -406,33 +406,35 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
406
406
|
const values = [];
|
|
407
407
|
let done = false;
|
|
408
408
|
let currentReadPromise = void 0;
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
if (
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
409
|
+
if (resHeaderRecord["transfer-encoding"] !== "chunked") {
|
|
410
|
+
let maxReadCount = 2;
|
|
411
|
+
for (let i = 0; i < maxReadCount; i++) {
|
|
412
|
+
currentReadPromise ||= reader.read();
|
|
413
|
+
const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {
|
|
414
|
+
console.error(e);
|
|
415
|
+
done = true;
|
|
416
|
+
});
|
|
417
|
+
if (!chunk) {
|
|
418
|
+
if (i === 1) {
|
|
419
|
+
await new Promise((resolve) => setTimeout(resolve));
|
|
420
|
+
maxReadCount = 3;
|
|
421
|
+
continue;
|
|
422
|
+
}
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
currentReadPromise = void 0;
|
|
426
|
+
if (chunk.value) {
|
|
427
|
+
values.push(chunk.value);
|
|
428
|
+
}
|
|
429
|
+
if (chunk.done) {
|
|
430
|
+
done = true;
|
|
431
|
+
break;
|
|
421
432
|
}
|
|
422
|
-
break;
|
|
423
|
-
}
|
|
424
|
-
currentReadPromise = void 0;
|
|
425
|
-
if (chunk.value) {
|
|
426
|
-
values.push(chunk.value);
|
|
427
433
|
}
|
|
428
|
-
if (
|
|
429
|
-
|
|
430
|
-
break;
|
|
434
|
+
if (done && !("content-length" in resHeaderRecord)) {
|
|
435
|
+
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
431
436
|
}
|
|
432
437
|
}
|
|
433
|
-
if (done && !("content-length" in resHeaderRecord)) {
|
|
434
|
-
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
435
|
-
}
|
|
436
438
|
outgoing.writeHead(res.status, resHeaderRecord);
|
|
437
439
|
values.forEach((value) => {
|
|
438
440
|
;
|
package/dist/server.js
CHANGED
|
@@ -444,33 +444,35 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
444
444
|
const values = [];
|
|
445
445
|
let done = false;
|
|
446
446
|
let currentReadPromise = void 0;
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
if (
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
447
|
+
if (resHeaderRecord["transfer-encoding"] !== "chunked") {
|
|
448
|
+
let maxReadCount = 2;
|
|
449
|
+
for (let i = 0; i < maxReadCount; i++) {
|
|
450
|
+
currentReadPromise ||= reader.read();
|
|
451
|
+
const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {
|
|
452
|
+
console.error(e);
|
|
453
|
+
done = true;
|
|
454
|
+
});
|
|
455
|
+
if (!chunk) {
|
|
456
|
+
if (i === 1) {
|
|
457
|
+
await new Promise((resolve) => setTimeout(resolve));
|
|
458
|
+
maxReadCount = 3;
|
|
459
|
+
continue;
|
|
460
|
+
}
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
currentReadPromise = void 0;
|
|
464
|
+
if (chunk.value) {
|
|
465
|
+
values.push(chunk.value);
|
|
466
|
+
}
|
|
467
|
+
if (chunk.done) {
|
|
468
|
+
done = true;
|
|
469
|
+
break;
|
|
459
470
|
}
|
|
460
|
-
break;
|
|
461
|
-
}
|
|
462
|
-
currentReadPromise = void 0;
|
|
463
|
-
if (chunk.value) {
|
|
464
|
-
values.push(chunk.value);
|
|
465
471
|
}
|
|
466
|
-
if (
|
|
467
|
-
|
|
468
|
-
break;
|
|
472
|
+
if (done && !("content-length" in resHeaderRecord)) {
|
|
473
|
+
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
469
474
|
}
|
|
470
475
|
}
|
|
471
|
-
if (done && !("content-length" in resHeaderRecord)) {
|
|
472
|
-
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
473
|
-
}
|
|
474
476
|
outgoing.writeHead(res.status, resHeaderRecord);
|
|
475
477
|
values.forEach((value) => {
|
|
476
478
|
;
|
package/dist/server.mjs
CHANGED
|
@@ -409,33 +409,35 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
409
409
|
const values = [];
|
|
410
410
|
let done = false;
|
|
411
411
|
let currentReadPromise = void 0;
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
if (
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
412
|
+
if (resHeaderRecord["transfer-encoding"] !== "chunked") {
|
|
413
|
+
let maxReadCount = 2;
|
|
414
|
+
for (let i = 0; i < maxReadCount; i++) {
|
|
415
|
+
currentReadPromise ||= reader.read();
|
|
416
|
+
const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {
|
|
417
|
+
console.error(e);
|
|
418
|
+
done = true;
|
|
419
|
+
});
|
|
420
|
+
if (!chunk) {
|
|
421
|
+
if (i === 1) {
|
|
422
|
+
await new Promise((resolve) => setTimeout(resolve));
|
|
423
|
+
maxReadCount = 3;
|
|
424
|
+
continue;
|
|
425
|
+
}
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
currentReadPromise = void 0;
|
|
429
|
+
if (chunk.value) {
|
|
430
|
+
values.push(chunk.value);
|
|
431
|
+
}
|
|
432
|
+
if (chunk.done) {
|
|
433
|
+
done = true;
|
|
434
|
+
break;
|
|
424
435
|
}
|
|
425
|
-
break;
|
|
426
|
-
}
|
|
427
|
-
currentReadPromise = void 0;
|
|
428
|
-
if (chunk.value) {
|
|
429
|
-
values.push(chunk.value);
|
|
430
436
|
}
|
|
431
|
-
if (
|
|
432
|
-
|
|
433
|
-
break;
|
|
437
|
+
if (done && !("content-length" in resHeaderRecord)) {
|
|
438
|
+
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
434
439
|
}
|
|
435
440
|
}
|
|
436
|
-
if (done && !("content-length" in resHeaderRecord)) {
|
|
437
|
-
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
438
|
-
}
|
|
439
441
|
outgoing.writeHead(res.status, resHeaderRecord);
|
|
440
442
|
values.forEach((value) => {
|
|
441
443
|
;
|
package/dist/vercel.js
CHANGED
|
@@ -442,33 +442,35 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
442
442
|
const values = [];
|
|
443
443
|
let done = false;
|
|
444
444
|
let currentReadPromise = void 0;
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
if (
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
445
|
+
if (resHeaderRecord["transfer-encoding"] !== "chunked") {
|
|
446
|
+
let maxReadCount = 2;
|
|
447
|
+
for (let i = 0; i < maxReadCount; i++) {
|
|
448
|
+
currentReadPromise ||= reader.read();
|
|
449
|
+
const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {
|
|
450
|
+
console.error(e);
|
|
451
|
+
done = true;
|
|
452
|
+
});
|
|
453
|
+
if (!chunk) {
|
|
454
|
+
if (i === 1) {
|
|
455
|
+
await new Promise((resolve) => setTimeout(resolve));
|
|
456
|
+
maxReadCount = 3;
|
|
457
|
+
continue;
|
|
458
|
+
}
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
currentReadPromise = void 0;
|
|
462
|
+
if (chunk.value) {
|
|
463
|
+
values.push(chunk.value);
|
|
464
|
+
}
|
|
465
|
+
if (chunk.done) {
|
|
466
|
+
done = true;
|
|
467
|
+
break;
|
|
457
468
|
}
|
|
458
|
-
break;
|
|
459
|
-
}
|
|
460
|
-
currentReadPromise = void 0;
|
|
461
|
-
if (chunk.value) {
|
|
462
|
-
values.push(chunk.value);
|
|
463
469
|
}
|
|
464
|
-
if (
|
|
465
|
-
|
|
466
|
-
break;
|
|
470
|
+
if (done && !("content-length" in resHeaderRecord)) {
|
|
471
|
+
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
467
472
|
}
|
|
468
473
|
}
|
|
469
|
-
if (done && !("content-length" in resHeaderRecord)) {
|
|
470
|
-
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
471
|
-
}
|
|
472
474
|
outgoing.writeHead(res.status, resHeaderRecord);
|
|
473
475
|
values.forEach((value) => {
|
|
474
476
|
;
|
package/dist/vercel.mjs
CHANGED
|
@@ -406,33 +406,35 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
406
406
|
const values = [];
|
|
407
407
|
let done = false;
|
|
408
408
|
let currentReadPromise = void 0;
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
if (
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
409
|
+
if (resHeaderRecord["transfer-encoding"] !== "chunked") {
|
|
410
|
+
let maxReadCount = 2;
|
|
411
|
+
for (let i = 0; i < maxReadCount; i++) {
|
|
412
|
+
currentReadPromise ||= reader.read();
|
|
413
|
+
const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {
|
|
414
|
+
console.error(e);
|
|
415
|
+
done = true;
|
|
416
|
+
});
|
|
417
|
+
if (!chunk) {
|
|
418
|
+
if (i === 1) {
|
|
419
|
+
await new Promise((resolve) => setTimeout(resolve));
|
|
420
|
+
maxReadCount = 3;
|
|
421
|
+
continue;
|
|
422
|
+
}
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
currentReadPromise = void 0;
|
|
426
|
+
if (chunk.value) {
|
|
427
|
+
values.push(chunk.value);
|
|
428
|
+
}
|
|
429
|
+
if (chunk.done) {
|
|
430
|
+
done = true;
|
|
431
|
+
break;
|
|
421
432
|
}
|
|
422
|
-
break;
|
|
423
|
-
}
|
|
424
|
-
currentReadPromise = void 0;
|
|
425
|
-
if (chunk.value) {
|
|
426
|
-
values.push(chunk.value);
|
|
427
433
|
}
|
|
428
|
-
if (
|
|
429
|
-
|
|
430
|
-
break;
|
|
434
|
+
if (done && !("content-length" in resHeaderRecord)) {
|
|
435
|
+
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
431
436
|
}
|
|
432
437
|
}
|
|
433
|
-
if (done && !("content-length" in resHeaderRecord)) {
|
|
434
|
-
resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
|
|
435
|
-
}
|
|
436
438
|
outgoing.writeHead(res.status, resHeaderRecord);
|
|
437
439
|
values.forEach((value) => {
|
|
438
440
|
;
|