@vercel/node
Advanced tools
+23
-0
@@ -1304,2 +1304,25 @@ var __create = Object.create; | ||
| } | ||
| const publicDir = process.env.VERCEL_DEV_PUBLIC_DIR; | ||
| if (publicDir && req.url) { | ||
| const { join: join2 } = await import("path"); | ||
| const { existsSync, statSync } = await import("fs"); | ||
| const { readFile: readFile2 } = await import("fs/promises"); | ||
| const staticPath = join2(process.cwd(), publicDir, req.url); | ||
| if (existsSync(staticPath) && statSync(staticPath).isFile()) { | ||
| try { | ||
| const content = await readFile2(staticPath); | ||
| const { extname: extname2 } = await import("path"); | ||
| const { contentType } = await import("mime-types"); | ||
| const url = new URL(req.url || "/", "http://localhost"); | ||
| const ext = extname2(url.pathname); | ||
| const mimeType = contentType(ext) || "application/octet-stream"; | ||
| res.setHeader("Content-Type", mimeType); | ||
| res.setHeader("Content-Length", content.length); | ||
| res.statusCode = 200; | ||
| res.end(content); | ||
| return; | ||
| } catch (error) { | ||
| } | ||
| } | ||
| } | ||
| if (!handleEvent) { | ||
@@ -1306,0 +1329,0 @@ res.statusCode = 500; |
+3
-1
| { | ||
| "name": "@vercel/node", | ||
| "version": "5.3.20", | ||
| "version": "5.3.21", | ||
| "license": "Apache-2.0", | ||
@@ -30,2 +30,3 @@ "main": "./dist/index", | ||
| "etag": "1.8.1", | ||
| "mime-types": "2.1.35", | ||
| "node-fetch": "2.6.9", | ||
@@ -49,2 +50,3 @@ "path-to-regexp-updated": "npm:path-to-regexp@6.3.0", | ||
| "@types/jest": "29.5.0", | ||
| "@types/mime-types": "2.1.4", | ||
| "@vitest/expect": "1.4.0", | ||
@@ -51,0 +53,0 @@ "content-type": "1.0.5", |
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
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 5 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances 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 2 instances in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
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 4 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances 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
2782638
0.04%72270
0.03%22
4.76%23
4.55%15
7.14%+ Added
+ Added
+ Added