Skip to content

Commit 4aeeb3a

Browse files
Annotate streamFilter TransformStream call as CodeQL false positive
The constructor takes three optional args per CF Workers types and the Web Streams spec; CodeQL's standard JS model uses an older signature and flags the single transformer arg as superfluous. Dismissed in the Code Quality dashboard. Comment is for the next reader so they don't re-investigate.
1 parent 34d6a01 commit 4aeeb3a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

workers/llm-proxy/src/services/streamFilter.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ export function createSafetyFilteredStream(source: ReadableStream<Uint8Array>):
2121
const decoder = new TextDecoder();
2222
const encoder = new TextEncoder();
2323

24+
// CodeQL's standard JS model flags the transformer arg as "superfluous"
25+
// against an older TransformStream signature. @cloudflare/workers-types and
26+
// the Web Streams spec define three optional args (transformer,
27+
// writableStrategy, readableStrategy); one transformer is correct. Dismissed
28+
// as false positive in the Code Quality dashboard.
2429
return source.pipeThrough(new TransformStream<Uint8Array, Uint8Array>({
2530
transform(chunk, controller) {
2631
if (scanner.isBlocked()) return; // Already blocked, drop remaining chunks

0 commit comments

Comments
 (0)