MCPcopy
hub / github.com/nanbingxyz/5ire / validateAndGetProxy

Function validateAndGetProxy

src/main/mcp.ts:50–59  ·  view source on GitHub ↗
(proxyUrl: string)

Source from the content-addressed store, hash-verified

48}
49
50function validateAndGetProxy(proxyUrl: string): string {
51 try {
52 // 使用URL构造函数验证URL格式
53 const url = new URL(proxyUrl);
54 return url.toString();
55 } catch (error) {
56 Container.inject(Logger).error(`Invalid proxy URL: ${proxyUrl}`, error);
57 throw new Error(`Invalid proxy URL: ${proxyUrl}`);
58 }
59}
60
61/**
62 * Checks if the client has tools capability.

Callers 1

activateMethod · 0.85

Calls 2

errorMethod · 0.80
injectMethod · 0.80

Tested by

no test coverage detected