MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / isSafeHttpUrl

Function isSafeHttpUrl

apps/kimi-code/src/utils/git/git-status.ts:296–304  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

294}
295
296function isSafeHttpUrl(value: string): boolean {
297 if (hasControlChars(value)) return false;
298 try {
299 const url = new URL(value);
300 return url.protocol === 'https:' || url.protocol === 'http:';
301 } catch {
302 return false;
303 }
304}
305
306function hasControlChars(value: string): boolean {
307 for (const char of value) {

Callers 2

parsePullRequestFunction · 0.70
toTerminalHyperlinkFunction · 0.70

Calls 1

hasControlCharsFunction · 0.70

Tested by

no test coverage detected