MCPcopy Create free account
hub / github.com/microsoft/AI-Engineering-Coach / hasUrlControlChars

Function hasUrlControlChars

src/webview/panel-shared.ts:72–78  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

70}
71
72function hasUrlControlChars(value: string): boolean {
73 for (let i = 0; i < value.length; i++) {
74 const code = value.charCodeAt(i);
75 if (code <= 0x1F || code === 0x7F) return true;
76 }
77 return false;
78}
79
80export function isSafeExternalHttpsUrl(value: unknown): value is string {
81 if (typeof value !== 'string' || hasUrlControlChars(value) || !value.toLowerCase().startsWith('https://')) {

Callers 1

isSafeExternalHttpsUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected