@hono/node-server 1.12.0 → 1.12.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/dist/index.js +16 -10
- package/dist/index.mjs +16 -10
- package/dist/listener.js +16 -10
- package/dist/listener.mjs +16 -10
- package/dist/server.js +16 -10
- package/dist/server.mjs +16 -10
- package/dist/vercel.js +16 -10
- package/dist/vercel.mjs +16 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -384,18 +384,24 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
384
384
|
const resHeaderRecord = buildOutgoingHttpHeaders(res.headers);
|
|
385
385
|
const internalBody = getInternalBody(res);
|
|
386
386
|
if (internalBody) {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
}
|
|
390
|
-
outgoing.writeHead(res.status, resHeaderRecord);
|
|
391
|
-
if (typeof internalBody.source === "string" || internalBody.source instanceof Uint8Array) {
|
|
392
|
-
outgoing.end(internalBody.source);
|
|
393
|
-
} else if (internalBody.source instanceof Blob) {
|
|
394
|
-
outgoing.end(new Uint8Array(await internalBody.source.arrayBuffer()));
|
|
387
|
+
const { length, source, stream } = internalBody;
|
|
388
|
+
if (source instanceof Uint8Array && source.byteLength !== length) {
|
|
395
389
|
} else {
|
|
396
|
-
|
|
390
|
+
if (length) {
|
|
391
|
+
resHeaderRecord["content-length"] = length;
|
|
392
|
+
}
|
|
393
|
+
outgoing.writeHead(res.status, resHeaderRecord);
|
|
394
|
+
if (typeof source === "string" || source instanceof Uint8Array) {
|
|
395
|
+
outgoing.end(source);
|
|
396
|
+
} else if (source instanceof Blob) {
|
|
397
|
+
outgoing.end(new Uint8Array(await source.arrayBuffer()));
|
|
398
|
+
} else {
|
|
399
|
+
await writeFromReadableStream(stream, outgoing);
|
|
400
|
+
}
|
|
401
|
+
return;
|
|
397
402
|
}
|
|
398
|
-
}
|
|
403
|
+
}
|
|
404
|
+
if (res.body) {
|
|
399
405
|
const {
|
|
400
406
|
"transfer-encoding": transferEncoding,
|
|
401
407
|
"content-encoding": contentEncoding,
|
package/dist/index.mjs
CHANGED
|
@@ -345,18 +345,24 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
345
345
|
const resHeaderRecord = buildOutgoingHttpHeaders(res.headers);
|
|
346
346
|
const internalBody = getInternalBody(res);
|
|
347
347
|
if (internalBody) {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}
|
|
351
|
-
outgoing.writeHead(res.status, resHeaderRecord);
|
|
352
|
-
if (typeof internalBody.source === "string" || internalBody.source instanceof Uint8Array) {
|
|
353
|
-
outgoing.end(internalBody.source);
|
|
354
|
-
} else if (internalBody.source instanceof Blob) {
|
|
355
|
-
outgoing.end(new Uint8Array(await internalBody.source.arrayBuffer()));
|
|
348
|
+
const { length, source, stream } = internalBody;
|
|
349
|
+
if (source instanceof Uint8Array && source.byteLength !== length) {
|
|
356
350
|
} else {
|
|
357
|
-
|
|
351
|
+
if (length) {
|
|
352
|
+
resHeaderRecord["content-length"] = length;
|
|
353
|
+
}
|
|
354
|
+
outgoing.writeHead(res.status, resHeaderRecord);
|
|
355
|
+
if (typeof source === "string" || source instanceof Uint8Array) {
|
|
356
|
+
outgoing.end(source);
|
|
357
|
+
} else if (source instanceof Blob) {
|
|
358
|
+
outgoing.end(new Uint8Array(await source.arrayBuffer()));
|
|
359
|
+
} else {
|
|
360
|
+
await writeFromReadableStream(stream, outgoing);
|
|
361
|
+
}
|
|
362
|
+
return;
|
|
358
363
|
}
|
|
359
|
-
}
|
|
364
|
+
}
|
|
365
|
+
if (res.body) {
|
|
360
366
|
const {
|
|
361
367
|
"transfer-encoding": transferEncoding,
|
|
362
368
|
"content-encoding": contentEncoding,
|
package/dist/listener.js
CHANGED
|
@@ -378,18 +378,24 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
378
378
|
const resHeaderRecord = buildOutgoingHttpHeaders(res.headers);
|
|
379
379
|
const internalBody = getInternalBody(res);
|
|
380
380
|
if (internalBody) {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
}
|
|
384
|
-
outgoing.writeHead(res.status, resHeaderRecord);
|
|
385
|
-
if (typeof internalBody.source === "string" || internalBody.source instanceof Uint8Array) {
|
|
386
|
-
outgoing.end(internalBody.source);
|
|
387
|
-
} else if (internalBody.source instanceof Blob) {
|
|
388
|
-
outgoing.end(new Uint8Array(await internalBody.source.arrayBuffer()));
|
|
381
|
+
const { length, source, stream } = internalBody;
|
|
382
|
+
if (source instanceof Uint8Array && source.byteLength !== length) {
|
|
389
383
|
} else {
|
|
390
|
-
|
|
384
|
+
if (length) {
|
|
385
|
+
resHeaderRecord["content-length"] = length;
|
|
386
|
+
}
|
|
387
|
+
outgoing.writeHead(res.status, resHeaderRecord);
|
|
388
|
+
if (typeof source === "string" || source instanceof Uint8Array) {
|
|
389
|
+
outgoing.end(source);
|
|
390
|
+
} else if (source instanceof Blob) {
|
|
391
|
+
outgoing.end(new Uint8Array(await source.arrayBuffer()));
|
|
392
|
+
} else {
|
|
393
|
+
await writeFromReadableStream(stream, outgoing);
|
|
394
|
+
}
|
|
395
|
+
return;
|
|
391
396
|
}
|
|
392
|
-
}
|
|
397
|
+
}
|
|
398
|
+
if (res.body) {
|
|
393
399
|
const {
|
|
394
400
|
"transfer-encoding": transferEncoding,
|
|
395
401
|
"content-encoding": contentEncoding,
|
package/dist/listener.mjs
CHANGED
|
@@ -342,18 +342,24 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
342
342
|
const resHeaderRecord = buildOutgoingHttpHeaders(res.headers);
|
|
343
343
|
const internalBody = getInternalBody(res);
|
|
344
344
|
if (internalBody) {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
}
|
|
348
|
-
outgoing.writeHead(res.status, resHeaderRecord);
|
|
349
|
-
if (typeof internalBody.source === "string" || internalBody.source instanceof Uint8Array) {
|
|
350
|
-
outgoing.end(internalBody.source);
|
|
351
|
-
} else if (internalBody.source instanceof Blob) {
|
|
352
|
-
outgoing.end(new Uint8Array(await internalBody.source.arrayBuffer()));
|
|
345
|
+
const { length, source, stream } = internalBody;
|
|
346
|
+
if (source instanceof Uint8Array && source.byteLength !== length) {
|
|
353
347
|
} else {
|
|
354
|
-
|
|
348
|
+
if (length) {
|
|
349
|
+
resHeaderRecord["content-length"] = length;
|
|
350
|
+
}
|
|
351
|
+
outgoing.writeHead(res.status, resHeaderRecord);
|
|
352
|
+
if (typeof source === "string" || source instanceof Uint8Array) {
|
|
353
|
+
outgoing.end(source);
|
|
354
|
+
} else if (source instanceof Blob) {
|
|
355
|
+
outgoing.end(new Uint8Array(await source.arrayBuffer()));
|
|
356
|
+
} else {
|
|
357
|
+
await writeFromReadableStream(stream, outgoing);
|
|
358
|
+
}
|
|
359
|
+
return;
|
|
355
360
|
}
|
|
356
|
-
}
|
|
361
|
+
}
|
|
362
|
+
if (res.body) {
|
|
357
363
|
const {
|
|
358
364
|
"transfer-encoding": transferEncoding,
|
|
359
365
|
"content-encoding": contentEncoding,
|
package/dist/server.js
CHANGED
|
@@ -380,18 +380,24 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
380
380
|
const resHeaderRecord = buildOutgoingHttpHeaders(res.headers);
|
|
381
381
|
const internalBody = getInternalBody(res);
|
|
382
382
|
if (internalBody) {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
}
|
|
386
|
-
outgoing.writeHead(res.status, resHeaderRecord);
|
|
387
|
-
if (typeof internalBody.source === "string" || internalBody.source instanceof Uint8Array) {
|
|
388
|
-
outgoing.end(internalBody.source);
|
|
389
|
-
} else if (internalBody.source instanceof Blob) {
|
|
390
|
-
outgoing.end(new Uint8Array(await internalBody.source.arrayBuffer()));
|
|
383
|
+
const { length, source, stream } = internalBody;
|
|
384
|
+
if (source instanceof Uint8Array && source.byteLength !== length) {
|
|
391
385
|
} else {
|
|
392
|
-
|
|
386
|
+
if (length) {
|
|
387
|
+
resHeaderRecord["content-length"] = length;
|
|
388
|
+
}
|
|
389
|
+
outgoing.writeHead(res.status, resHeaderRecord);
|
|
390
|
+
if (typeof source === "string" || source instanceof Uint8Array) {
|
|
391
|
+
outgoing.end(source);
|
|
392
|
+
} else if (source instanceof Blob) {
|
|
393
|
+
outgoing.end(new Uint8Array(await source.arrayBuffer()));
|
|
394
|
+
} else {
|
|
395
|
+
await writeFromReadableStream(stream, outgoing);
|
|
396
|
+
}
|
|
397
|
+
return;
|
|
393
398
|
}
|
|
394
|
-
}
|
|
399
|
+
}
|
|
400
|
+
if (res.body) {
|
|
395
401
|
const {
|
|
396
402
|
"transfer-encoding": transferEncoding,
|
|
397
403
|
"content-encoding": contentEncoding,
|
package/dist/server.mjs
CHANGED
|
@@ -345,18 +345,24 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
345
345
|
const resHeaderRecord = buildOutgoingHttpHeaders(res.headers);
|
|
346
346
|
const internalBody = getInternalBody(res);
|
|
347
347
|
if (internalBody) {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}
|
|
351
|
-
outgoing.writeHead(res.status, resHeaderRecord);
|
|
352
|
-
if (typeof internalBody.source === "string" || internalBody.source instanceof Uint8Array) {
|
|
353
|
-
outgoing.end(internalBody.source);
|
|
354
|
-
} else if (internalBody.source instanceof Blob) {
|
|
355
|
-
outgoing.end(new Uint8Array(await internalBody.source.arrayBuffer()));
|
|
348
|
+
const { length, source, stream } = internalBody;
|
|
349
|
+
if (source instanceof Uint8Array && source.byteLength !== length) {
|
|
356
350
|
} else {
|
|
357
|
-
|
|
351
|
+
if (length) {
|
|
352
|
+
resHeaderRecord["content-length"] = length;
|
|
353
|
+
}
|
|
354
|
+
outgoing.writeHead(res.status, resHeaderRecord);
|
|
355
|
+
if (typeof source === "string" || source instanceof Uint8Array) {
|
|
356
|
+
outgoing.end(source);
|
|
357
|
+
} else if (source instanceof Blob) {
|
|
358
|
+
outgoing.end(new Uint8Array(await source.arrayBuffer()));
|
|
359
|
+
} else {
|
|
360
|
+
await writeFromReadableStream(stream, outgoing);
|
|
361
|
+
}
|
|
362
|
+
return;
|
|
358
363
|
}
|
|
359
|
-
}
|
|
364
|
+
}
|
|
365
|
+
if (res.body) {
|
|
360
366
|
const {
|
|
361
367
|
"transfer-encoding": transferEncoding,
|
|
362
368
|
"content-encoding": contentEncoding,
|
package/dist/vercel.js
CHANGED
|
@@ -378,18 +378,24 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
378
378
|
const resHeaderRecord = buildOutgoingHttpHeaders(res.headers);
|
|
379
379
|
const internalBody = getInternalBody(res);
|
|
380
380
|
if (internalBody) {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
}
|
|
384
|
-
outgoing.writeHead(res.status, resHeaderRecord);
|
|
385
|
-
if (typeof internalBody.source === "string" || internalBody.source instanceof Uint8Array) {
|
|
386
|
-
outgoing.end(internalBody.source);
|
|
387
|
-
} else if (internalBody.source instanceof Blob) {
|
|
388
|
-
outgoing.end(new Uint8Array(await internalBody.source.arrayBuffer()));
|
|
381
|
+
const { length, source, stream } = internalBody;
|
|
382
|
+
if (source instanceof Uint8Array && source.byteLength !== length) {
|
|
389
383
|
} else {
|
|
390
|
-
|
|
384
|
+
if (length) {
|
|
385
|
+
resHeaderRecord["content-length"] = length;
|
|
386
|
+
}
|
|
387
|
+
outgoing.writeHead(res.status, resHeaderRecord);
|
|
388
|
+
if (typeof source === "string" || source instanceof Uint8Array) {
|
|
389
|
+
outgoing.end(source);
|
|
390
|
+
} else if (source instanceof Blob) {
|
|
391
|
+
outgoing.end(new Uint8Array(await source.arrayBuffer()));
|
|
392
|
+
} else {
|
|
393
|
+
await writeFromReadableStream(stream, outgoing);
|
|
394
|
+
}
|
|
395
|
+
return;
|
|
391
396
|
}
|
|
392
|
-
}
|
|
397
|
+
}
|
|
398
|
+
if (res.body) {
|
|
393
399
|
const {
|
|
394
400
|
"transfer-encoding": transferEncoding,
|
|
395
401
|
"content-encoding": contentEncoding,
|
package/dist/vercel.mjs
CHANGED
|
@@ -342,18 +342,24 @@ var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
|
342
342
|
const resHeaderRecord = buildOutgoingHttpHeaders(res.headers);
|
|
343
343
|
const internalBody = getInternalBody(res);
|
|
344
344
|
if (internalBody) {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
}
|
|
348
|
-
outgoing.writeHead(res.status, resHeaderRecord);
|
|
349
|
-
if (typeof internalBody.source === "string" || internalBody.source instanceof Uint8Array) {
|
|
350
|
-
outgoing.end(internalBody.source);
|
|
351
|
-
} else if (internalBody.source instanceof Blob) {
|
|
352
|
-
outgoing.end(new Uint8Array(await internalBody.source.arrayBuffer()));
|
|
345
|
+
const { length, source, stream } = internalBody;
|
|
346
|
+
if (source instanceof Uint8Array && source.byteLength !== length) {
|
|
353
347
|
} else {
|
|
354
|
-
|
|
348
|
+
if (length) {
|
|
349
|
+
resHeaderRecord["content-length"] = length;
|
|
350
|
+
}
|
|
351
|
+
outgoing.writeHead(res.status, resHeaderRecord);
|
|
352
|
+
if (typeof source === "string" || source instanceof Uint8Array) {
|
|
353
|
+
outgoing.end(source);
|
|
354
|
+
} else if (source instanceof Blob) {
|
|
355
|
+
outgoing.end(new Uint8Array(await source.arrayBuffer()));
|
|
356
|
+
} else {
|
|
357
|
+
await writeFromReadableStream(stream, outgoing);
|
|
358
|
+
}
|
|
359
|
+
return;
|
|
355
360
|
}
|
|
356
|
-
}
|
|
361
|
+
}
|
|
362
|
+
if (res.body) {
|
|
357
363
|
const {
|
|
358
364
|
"transfer-encoding": transferEncoding,
|
|
359
365
|
"content-encoding": contentEncoding,
|