Skip to content

Commit 7a95ebe

Browse files
committed
test(onboard): reject escaped endpoint echoes
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
1 parent 93c4d9b commit 7a95ebe

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

test/onboard-endpoint-url-rejection.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,10 @@ setupNim(null).then(
180180
assert.equal(result.status, 0, result.stderr);
181181
assert.deepEqual(JSON.parse(result.stdout.trim()), { exitCode: 1 });
182182
assert.match(result.stderr, expectedMessage);
183-
// The rejection must not echo the unsafe input back to the terminal.
183+
// The rejection must not echo the unsafe input back to the terminal,
184+
// including through JSON-style escaping of control characters.
184185
assert.ok(!result.stderr.includes(endpointUrl));
186+
assert.ok(!result.stderr.includes(JSON.stringify(endpointUrl).slice(1, -1)));
185187
// The QA contract (#9301): rejection fires before any network request
186188
// or persistent state write, so the environment stays unchanged.
187189
assert.ok(!fs.existsSync(curlMarkerPath));

0 commit comments

Comments
 (0)