@vercel/node
Advanced tools
@@ -14,2 +14,3 @@ "use strict"; | ||
| const ts_node_1 = require("ts-node"); | ||
| let useRequire = false; | ||
| if (!process.env.VERCEL_DEV_IS_ESM) { | ||
@@ -76,2 +77,3 @@ const resolveTypescript = (p) => { | ||
| }); | ||
| useRequire = true; | ||
| } | ||
@@ -101,2 +103,3 @@ const http_1 = require("http"); | ||
| shouldAddHelpers, | ||
| useRequire, | ||
| }); | ||
@@ -103,0 +106,0 @@ bridge = launcher(); |
+23
-10
@@ -29,2 +29,3 @@ const { parse } = require('url'); | ||
| const helpersPath = ${JSON.stringify(helpersPath)}; | ||
| const useRequire = false; | ||
@@ -42,2 +43,3 @@ const func = (${getVercelLauncher(config).toString()})(); | ||
| shouldAddHelpers = false, | ||
| useRequire = false, | ||
| }) { | ||
@@ -63,10 +65,18 @@ return function () { | ||
| import(entrypointPath) | ||
| async function getListener() { | ||
| let listener = useRequire | ||
| ? require(entrypointPath) | ||
| : await import(entrypointPath); | ||
| // In some cases we might have nested default props | ||
| // due to TS => JS | ||
| for (let i = 0; i < 5; i++) { | ||
| if (listener.default) listener = listener.default; | ||
| } | ||
| return listener; | ||
| } | ||
| getListener() | ||
| .then(listener => { | ||
| // In some cases we might have nested default props | ||
| // due to TS => JS | ||
| for (let i = 0; i < 5; i++) { | ||
| if (listener.default) listener = listener.default; | ||
| } | ||
| if (typeof listener.listen === 'function') { | ||
@@ -149,5 +159,8 @@ Server.prototype.listen = originalListen; | ||
| function internal(e, context, callback) { | ||
| const { path, method: httpMethod, body, headers } = JSON.parse( | ||
| e.body || '{}' | ||
| ); | ||
| const { | ||
| path, | ||
| method: httpMethod, | ||
| body, | ||
| headers, | ||
| } = JSON.parse(e.body || '{}'); | ||
| const { query } = parse(path, true); | ||
@@ -154,0 +167,0 @@ /** |
+3
-3
| { | ||
| "name": "@vercel/node", | ||
| "version": "1.11.2-canary.3", | ||
| "version": "1.11.2-canary.4", | ||
| "license": "MIT", | ||
@@ -37,3 +37,3 @@ "main": "./dist/index", | ||
| "@vercel/nft": "0.13.1", | ||
| "@vercel/node-bridge": "2.0.1-canary.1", | ||
| "@vercel/node-bridge": "2.0.1-canary.2", | ||
| "content-type": "1.0.4", | ||
@@ -47,3 +47,3 @@ "cookie": "0.4.0", | ||
| }, | ||
| "gitHead": "cf827a8b919ff6eed383863af39c26d51b2aa16e" | ||
| "gitHead": "0a09a5232c9ffddcc68475bf05fccd56ebe946d1" | ||
| } |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 8 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 8 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
3318225
0.01%92277
0.02%42
2.44%