@hono/node-server 1.19.1 → 1.19.3
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 +2 -1
- package/dist/index.mjs +2 -1
- package/dist/listener.js +2 -1
- package/dist/listener.mjs +2 -1
- package/dist/serve-static.js +2 -2
- package/dist/serve-static.mjs +2 -2
- package/dist/server.js +2 -1
- package/dist/server.mjs +2 -1
- package/dist/vercel.js +2 -1
- package/dist/vercel.mjs +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -430,8 +430,9 @@ var responseViaCache = async (res, outgoing) => {
|
|
|
430
430
|
;
|
|
431
431
|
outgoing[outgoingEnded]?.();
|
|
432
432
|
};
|
|
433
|
+
var isPromise = (res) => typeof res.then === "function";
|
|
433
434
|
var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
434
|
-
if (res
|
|
435
|
+
if (isPromise(res)) {
|
|
435
436
|
if (options.errorHandler) {
|
|
436
437
|
try {
|
|
437
438
|
res = await res;
|
package/dist/index.mjs
CHANGED
|
@@ -391,8 +391,9 @@ var responseViaCache = async (res, outgoing) => {
|
|
|
391
391
|
;
|
|
392
392
|
outgoing[outgoingEnded]?.();
|
|
393
393
|
};
|
|
394
|
+
var isPromise = (res) => typeof res.then === "function";
|
|
394
395
|
var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
395
|
-
if (res
|
|
396
|
+
if (isPromise(res)) {
|
|
396
397
|
if (options.errorHandler) {
|
|
397
398
|
try {
|
|
398
399
|
res = await res;
|
package/dist/listener.js
CHANGED
|
@@ -422,8 +422,9 @@ var responseViaCache = async (res, outgoing) => {
|
|
|
422
422
|
;
|
|
423
423
|
outgoing[outgoingEnded]?.();
|
|
424
424
|
};
|
|
425
|
+
var isPromise = (res) => typeof res.then === "function";
|
|
425
426
|
var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
426
|
-
if (res
|
|
427
|
+
if (isPromise(res)) {
|
|
427
428
|
if (options.errorHandler) {
|
|
428
429
|
try {
|
|
429
430
|
res = await res;
|
package/dist/listener.mjs
CHANGED
|
@@ -388,8 +388,9 @@ var responseViaCache = async (res, outgoing) => {
|
|
|
388
388
|
;
|
|
389
389
|
outgoing[outgoingEnded]?.();
|
|
390
390
|
};
|
|
391
|
+
var isPromise = (res) => typeof res.then === "function";
|
|
391
392
|
var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
392
|
-
if (res
|
|
393
|
+
if (isPromise(res)) {
|
|
393
394
|
if (options.errorHandler) {
|
|
394
395
|
try {
|
|
395
396
|
res = await res;
|
package/dist/serve-static.js
CHANGED
|
@@ -130,8 +130,8 @@ var serveStatic = (options = { root: "" }) => {
|
|
|
130
130
|
c.header("Accept-Ranges", "bytes");
|
|
131
131
|
c.header("Date", stats.birthtime.toUTCString());
|
|
132
132
|
const parts = range.replace(/bytes=/, "").split("-", 2);
|
|
133
|
-
const start =
|
|
134
|
-
let end =
|
|
133
|
+
const start = parseInt(parts[0], 10) || 0;
|
|
134
|
+
let end = parseInt(parts[1], 10) || size - 1;
|
|
135
135
|
if (size < end - start + 1) {
|
|
136
136
|
end = size - 1;
|
|
137
137
|
}
|
package/dist/serve-static.mjs
CHANGED
|
@@ -106,8 +106,8 @@ var serveStatic = (options = { root: "" }) => {
|
|
|
106
106
|
c.header("Accept-Ranges", "bytes");
|
|
107
107
|
c.header("Date", stats.birthtime.toUTCString());
|
|
108
108
|
const parts = range.replace(/bytes=/, "").split("-", 2);
|
|
109
|
-
const start =
|
|
110
|
-
let end =
|
|
109
|
+
const start = parseInt(parts[0], 10) || 0;
|
|
110
|
+
let end = parseInt(parts[1], 10) || size - 1;
|
|
111
111
|
if (size < end - start + 1) {
|
|
112
112
|
end = size - 1;
|
|
113
113
|
}
|
package/dist/server.js
CHANGED
|
@@ -426,8 +426,9 @@ var responseViaCache = async (res, outgoing) => {
|
|
|
426
426
|
;
|
|
427
427
|
outgoing[outgoingEnded]?.();
|
|
428
428
|
};
|
|
429
|
+
var isPromise = (res) => typeof res.then === "function";
|
|
429
430
|
var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
430
|
-
if (res
|
|
431
|
+
if (isPromise(res)) {
|
|
431
432
|
if (options.errorHandler) {
|
|
432
433
|
try {
|
|
433
434
|
res = await res;
|
package/dist/server.mjs
CHANGED
|
@@ -391,8 +391,9 @@ var responseViaCache = async (res, outgoing) => {
|
|
|
391
391
|
;
|
|
392
392
|
outgoing[outgoingEnded]?.();
|
|
393
393
|
};
|
|
394
|
+
var isPromise = (res) => typeof res.then === "function";
|
|
394
395
|
var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
395
|
-
if (res
|
|
396
|
+
if (isPromise(res)) {
|
|
396
397
|
if (options.errorHandler) {
|
|
397
398
|
try {
|
|
398
399
|
res = await res;
|
package/dist/vercel.js
CHANGED
|
@@ -424,8 +424,9 @@ var responseViaCache = async (res, outgoing) => {
|
|
|
424
424
|
;
|
|
425
425
|
outgoing[outgoingEnded]?.();
|
|
426
426
|
};
|
|
427
|
+
var isPromise = (res) => typeof res.then === "function";
|
|
427
428
|
var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
428
|
-
if (res
|
|
429
|
+
if (isPromise(res)) {
|
|
429
430
|
if (options.errorHandler) {
|
|
430
431
|
try {
|
|
431
432
|
res = await res;
|
package/dist/vercel.mjs
CHANGED
|
@@ -388,8 +388,9 @@ var responseViaCache = async (res, outgoing) => {
|
|
|
388
388
|
;
|
|
389
389
|
outgoing[outgoingEnded]?.();
|
|
390
390
|
};
|
|
391
|
+
var isPromise = (res) => typeof res.then === "function";
|
|
391
392
|
var responseViaResponseObject = async (res, outgoing, options = {}) => {
|
|
392
|
-
if (res
|
|
393
|
+
if (isPromise(res)) {
|
|
393
394
|
if (options.errorHandler) {
|
|
394
395
|
try {
|
|
395
396
|
res = await res;
|