summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2022-12-06 14:30:13 +0000
committerAndrei Zeliankou <zelenkov@nginx.com>2022-12-06 14:30:13 +0000
commitd862f581db968519fb7adb38c8872d020f4f21e6 (patch)
treebdce3c93590bf835ea4ef0645b2a8020aaefd5b8 /src
parent491d0f700f5690eba0f1fcf2124f3a37ef73eb1a (diff)
downloadunit-d862f581db968519fb7adb38c8872d020f4f21e6.tar.gz
unit-d862f581db968519fb7adb38c8872d020f4f21e6.tar.bz2
Node.js: added "shortCircuit" option for ES modules hook.
Starting from Node.js v18.6.0 return value from all hooks must have "shortCircuit: true" option specified. For more information see: https://github.com/nodejs/node/commit/10bcad5c6e
Diffstat (limited to 'src')
-rw-r--r--src/nodejs/unit-http/loader.mjs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nodejs/unit-http/loader.mjs b/src/nodejs/unit-http/loader.mjs
index 546548f5..83985b0f 100644
--- a/src/nodejs/unit-http/loader.mjs
+++ b/src/nodejs/unit-http/loader.mjs
@@ -4,13 +4,15 @@ export async function resolve(specifier, context, defaultResolver) {
case "websocket":
return {
url: new URL("./websocket.js", import.meta.url).href,
- format: "commonjs"
+ format: "commonjs",
+ shortCircuit: true,
}
case "http":
return {
url: new URL("./http.js", import.meta.url).href,
- format: "commonjs"
+ format: "commonjs",
+ shortCircuit: true,
}
}