MCPcopy
hub / github.com/github/awesome-copilot / sanitizeToolUrl

Function sanitizeToolUrl

website/src/scripts/pages/tools-render.ts:50–66  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

48}
49
50function sanitizeToolUrl(url: string): string {
51 try {
52 const protocol = new URL(url).protocol;
53 if (
54 protocol === "http:" ||
55 protocol === "https:" ||
56 protocol === "vscode:" ||
57 protocol === "vscode-insiders:"
58 ) {
59 return escapeHtml(url);
60 }
61 } catch {
62 return "#";
63 }
64
65 return "#";
66}
67
68function getToolActionLink(
69 href: string | undefined,

Callers 1

getToolActionLinkFunction · 0.85

Calls 1

escapeHtmlFunction · 0.90

Tested by

no test coverage detected