Skip to content

Commit 4791532

Browse files
murderteethclaude
andcommitted
Address Copilot review nits
Fixes US spelling (recognised -> recognized) across docs, QLDoc, change note, and test fixture comments. Clarifies the handler QLDoc to note sync/async support. Renames the supported-frameworks entry from "vercel" to "Vercel (@vercel/node)" to avoid implying broader platform coverage. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cff0734 commit 4791532

File tree

6 files changed

+10
-9
lines changed

6 files changed

+10
-9
lines changed

docs/codeql/reusables/supported-frameworks.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ and the CodeQL library pack ``codeql/javascript-all`` (`changelog <https://githu
197197
superagent, Network communicator
198198
swig, templating language
199199
underscore, Utility library
200-
vercel, Serverless framework
200+
Vercel (@vercel/node), Serverless framework
201201
vue, HTML framework
202202

203203

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
category: newFeature
33
---
4-
* Added support for [`@vercel/node`](https://www.npmjs.com/package/@vercel/node) Vercel serverless functions. Handlers are recognised via the `VercelRequest`/`VercelResponse` TypeScript parameter types, and standard security queries (`js/reflected-xss`, `js/request-forgery`, `js/sql-injection`, `js/command-line-injection`, etc.) now detect vulnerabilities in Vercel API route files.
4+
* Added support for [`@vercel/node`](https://www.npmjs.com/package/@vercel/node) Vercel serverless functions. Handlers are recognized via the `VercelRequest`/`VercelResponse` TypeScript parameter types, and standard security queries (`js/reflected-xss`, `js/request-forgery`, `js/sql-injection`, `js/command-line-injection`, etc.) now detect vulnerabilities in Vercel API route files.

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import semmle.javascript.frameworks.HTTP
99
* Provides classes for working with [@vercel/node](https://www.npmjs.com/package/@vercel/node) Vercel serverless functions.
1010
*
1111
* A Vercel serverless function is a module whose default export is a function
12-
* with signature `(req: VercelRequest, res: VercelResponse) => void`, where
13-
* the types are imported from the `@vercel/node` package. The Vercel runtime
14-
* invokes the default export for every incoming HTTP request.
12+
* taking parameters `(req: VercelRequest, res: VercelResponse)`, where the
13+
* types are imported from the `@vercel/node` package. The default export may
14+
* be synchronous or `async`, and the Vercel runtime invokes it for every
15+
* incoming HTTP request.
1516
*/
1617
module VercelNode {
1718
/**
@@ -20,7 +21,7 @@ module VercelNode {
2021
* `VercelResponse` from `@vercel/node`.
2122
*
2223
* Since `@vercel/node` is commonly imported as a type-only import, handlers
23-
* are recognised by their TypeScript parameter types. The default-export
24+
* are recognized by their TypeScript parameter types. The default-export
2425
* constraint excludes private helpers or test utilities that share the
2526
* same signature.
2627
*/

javascript/ql/test/library-tests/frameworks/vercel/src/notahandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { VercelRequest, VercelResponse } from "@vercel/node";
22

33
// A default-exported function that has VercelRequest/VercelResponse at
44
// positions 1 and 2, not 0 and 1. Vercel does not invoke it this way,
5-
// so it must NOT be recognised as a route handler.
5+
// so it must NOT be recognized as a route handler.
66
export default function notAHandler(ctx: unknown, req: VercelRequest, res: VercelResponse) {
77
res.send(req.query.name);
88
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { NowRequest, NowResponse } from "@now/node";
22

33
// Legacy Zeit-era aliases. The model should treat these identically to
4-
// the modern @vercel/node NowRequest -> VercelRequest, NowResponse -> VercelResponse.
4+
// the modern @vercel/node types (NowRequest -> VercelRequest, NowResponse -> VercelResponse).
55
export default function handler(req: NowRequest, res: NowResponse) {
66
res.send(req.query.name);
77
}

javascript/ql/test/library-tests/frameworks/vercel/src/vercel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { VercelRequest, VercelResponse } from "@vercel/node";
22

3-
// A private helper with the same signature. Must NOT be recognised as a
3+
// A private helper with the same signature. Must NOT be recognized as a
44
// route handler, since Vercel only invokes the default export.
55
function internalHelper(req: VercelRequest, res: VercelResponse) {
66
res.send(req.query.name);

0 commit comments

Comments
 (0)