Skip to content

Commit 8ef6507

Browse files
vvillait88claude
andcommitted
fix(test): tighten URL substring assertion to silence CodeQL false positive
CodeQL flagged \`assert "https://my.merchant" in section\` as \`py/incomplete-url-substring-sanitization\` (high severity). The pattern matters when checking whether a user-supplied URL falls inside an allowlist substring; here it's a test assertion verifying the rendered llms.txt section contains the test fixture's app_url. Same effect with a more specific substring (\`agentscore-pay pay POST https://my.merchant\`) — CodeQL no longer matches the dangerous pattern. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 84b789f commit 8ef6507

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/test_discovery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def test_emits_multi_step_setup_per_rail(self):
124124
assert "### How to pay with x402" in section
125125
assert "npm install -g @agent-score/pay" in section
126126
assert "agentscore-pay wallet create" in section
127-
assert "https://my.merchant" in section
127+
assert "agentscore-pay pay POST https://my.merchant" in section
128128

129129
def test_omits_sections_for_unconfigured_rails(self):
130130
section = llms_txt_payment_section(

0 commit comments

Comments
 (0)