From 8dccac2fa370a21f31f0fbfc88f11481f95211ca Mon Sep 17 00:00:00 2001 From: Atlas Date: Tue, 31 Mar 2026 21:44:13 -0700 Subject: [PATCH] Potential fix for code scanning alert no. 17: Incomplete URL substring sanitization Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- extension/src/ui/hoverPanel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/src/ui/hoverPanel.ts b/extension/src/ui/hoverPanel.ts index e9b749d..3dc3bec 100644 --- a/extension/src/ui/hoverPanel.ts +++ b/extension/src/ui/hoverPanel.ts @@ -253,7 +253,7 @@ export class HoverPanel { try { const host = new URL(candidateUrl).hostname.replace(/^www\./, ''); if (!host) return undefined; - return host.includes('docs.python.org') ? 'Python docs' : host; + return host === 'docs.python.org' ? 'Python docs' : host; } catch { return undefined; }