@hono/node-server
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -65,9 +65,7 @@ "use strict"; | ||
throw new TypeError("ReadableStream is locked."); | ||
} else if (writable.destroyed) { | ||
stream.cancel(); | ||
return; | ||
} | ||
const reader = stream.getReader(); | ||
if (writable.destroyed) { | ||
reader.cancel(); | ||
return; | ||
} | ||
writable.on("drain", onDrain); | ||
writable.on("close", cancel); | ||
@@ -79,3 +77,2 @@ writable.on("error", cancel); | ||
writable.off("error", cancel); | ||
writable.off("drain", onDrain); | ||
}); | ||
@@ -95,3 +92,5 @@ function cancel(error) { | ||
writable.end(); | ||
} else if (writable.write(value)) { | ||
} else if (!writable.write(value)) { | ||
writable.once("drain", onDrain); | ||
} else { | ||
return reader.read().then(flow, cancel); | ||
@@ -98,0 +97,0 @@ } |
@@ -58,9 +58,7 @@ "use strict"; | ||
throw new TypeError("ReadableStream is locked."); | ||
} else if (writable.destroyed) { | ||
stream.cancel(); | ||
return; | ||
} | ||
const reader = stream.getReader(); | ||
if (writable.destroyed) { | ||
reader.cancel(); | ||
return; | ||
} | ||
writable.on("drain", onDrain); | ||
writable.on("close", cancel); | ||
@@ -72,3 +70,2 @@ writable.on("error", cancel); | ||
writable.off("error", cancel); | ||
writable.off("drain", onDrain); | ||
}); | ||
@@ -88,3 +85,5 @@ function cancel(error) { | ||
writable.end(); | ||
} else if (writable.write(value)) { | ||
} else if (!writable.write(value)) { | ||
writable.once("drain", onDrain); | ||
} else { | ||
return reader.read().then(flow, cancel); | ||
@@ -91,0 +90,0 @@ } |
@@ -194,7 +194,5 @@ "use strict"; | ||
c.header("Date", stat.birthtime.toUTCString()); | ||
let start = 0; | ||
let end = stat.size - 1; | ||
const parts = range.replace(/bytes=/, "").split("-"); | ||
start = parseInt(parts[0], 10); | ||
end = parts[1] ? parseInt(parts[1], 10) : end; | ||
const parts = range.replace(/bytes=/, "").split("-", 2); | ||
const start = parts[0] ? parseInt(parts[0], 10) : 0; | ||
let end = parts[1] ? parseInt(parts[1], 10) : stat.size - 1; | ||
if (size < end - start + 1) { | ||
@@ -201,0 +199,0 @@ end = size - 1; |
@@ -62,9 +62,7 @@ "use strict"; | ||
throw new TypeError("ReadableStream is locked."); | ||
} else if (writable.destroyed) { | ||
stream.cancel(); | ||
return; | ||
} | ||
const reader = stream.getReader(); | ||
if (writable.destroyed) { | ||
reader.cancel(); | ||
return; | ||
} | ||
writable.on("drain", onDrain); | ||
writable.on("close", cancel); | ||
@@ -76,3 +74,2 @@ writable.on("error", cancel); | ||
writable.off("error", cancel); | ||
writable.off("drain", onDrain); | ||
}); | ||
@@ -92,3 +89,5 @@ function cancel(error) { | ||
writable.end(); | ||
} else if (writable.write(value)) { | ||
} else if (!writable.write(value)) { | ||
writable.once("drain", onDrain); | ||
} else { | ||
return reader.read().then(flow, cancel); | ||
@@ -95,0 +94,0 @@ } |
@@ -29,9 +29,7 @@ "use strict"; | ||
throw new TypeError("ReadableStream is locked."); | ||
} else if (writable.destroyed) { | ||
stream.cancel(); | ||
return; | ||
} | ||
const reader = stream.getReader(); | ||
if (writable.destroyed) { | ||
reader.cancel(); | ||
return; | ||
} | ||
writable.on("drain", onDrain); | ||
writable.on("close", cancel); | ||
@@ -43,3 +41,2 @@ writable.on("error", cancel); | ||
writable.off("error", cancel); | ||
writable.off("drain", onDrain); | ||
}); | ||
@@ -59,3 +56,5 @@ function cancel(error) { | ||
writable.end(); | ||
} else if (writable.write(value)) { | ||
} else if (!writable.write(value)) { | ||
writable.once("drain", onDrain); | ||
} else { | ||
return reader.read().then(flow, cancel); | ||
@@ -62,0 +61,0 @@ } |
@@ -60,9 +60,7 @@ "use strict"; | ||
throw new TypeError("ReadableStream is locked."); | ||
} else if (writable.destroyed) { | ||
stream.cancel(); | ||
return; | ||
} | ||
const reader = stream.getReader(); | ||
if (writable.destroyed) { | ||
reader.cancel(); | ||
return; | ||
} | ||
writable.on("drain", onDrain); | ||
writable.on("close", cancel); | ||
@@ -74,3 +72,2 @@ writable.on("error", cancel); | ||
writable.off("error", cancel); | ||
writable.off("drain", onDrain); | ||
}); | ||
@@ -90,3 +87,5 @@ function cancel(error) { | ||
writable.end(); | ||
} else if (writable.write(value)) { | ||
} else if (!writable.write(value)) { | ||
writable.once("drain", onDrain); | ||
} else { | ||
return reader.read().then(flow, cancel); | ||
@@ -93,0 +92,0 @@ } |
{ | ||
"name": "@hono/node-server", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Node.js Adapter for Hono", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70969
1898