Recognize legacy @now/node type aliases · BazookaMusic/codeql@cff0734 · GitHub
Skip to content

Commit cff0734

Browse files
committed
Recognize legacy @now/node type aliases
Extends the Vercel serverless handler detection to also match the deprecated Zeit-era @now/node package with NowRequest/NowResponse types. Per-review feedback from asgerf, these aliases still appear in real-world code. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent dfe0559 commit cff0734

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎javascript/ql/lib/semmle/javascript/frameworks/VercelNode.qll‎

Lines changed: 2 additions & 2 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { NowRequest, NowResponse } from "@now/node";
2+
3+
// Legacy Zeit-era aliases. The model should treat these identically to
4+
// the modern @vercel/node NowRequest -> VercelRequest, NowResponse -> VercelResponse.
5+
export default function handler(req: NowRequest, res: NowResponse) {
6+
res.send(req.query.name);
7+
}

‎javascript/ql/test/library-tests/frameworks/vercel/tests.expected‎

Lines changed: 5 additions & 0 deletions

0 commit comments

Comments
 (0)