@jsenv/server 9.2.2 → 9.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/server",
3
- "version": "9.2.2",
3
+ "version": "9.2.3",
4
4
  "description": "Write your Node.js server using pure functions",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -67,7 +67,10 @@ const createRequestAbortSignal = ({ nodeRequest, serverOperation }) => {
67
67
  abortController.abort()
68
68
  },
69
69
  request_close: () => {
70
- abortController.abort()
70
+ if (!nodeRequest.complete) {
71
+ // aborted while reading request body
72
+ abortController.abort()
73
+ }
71
74
  },
72
75
  // no special effects on thoose, just remove other callbacks
73
76
  request_error: () => {},
@@ -90,7 +90,8 @@ export const populateNodeResponse = async (
90
90
  // where body is kept open to write to client
91
91
  // and the browser is reloaded or closed for instance
92
92
  subscription.unsubscribe()
93
- onEnd()
93
+ responseStream.destroy()
94
+ onAbort()
94
95
  resolve()
95
96
  },
96
97
  finish: () => {