MCPcopy Index your code
hub / github.com/callstack/agent-device / resolveProxyRoute

Function resolveProxyRoute

src/remote/daemon-proxy.ts:276–283  ·  view source on GitHub ↗
(requestUrl: string)

Source from the content-addressed store, hash-verified

274}
275
276function resolveProxyRoute(requestUrl: string): string {
277 const pathname = new URL(requestUrl, 'http://127.0.0.1').pathname;
278 if (pathname === DAEMON_HTTP_BASE_PATH) return '/';
279 if (pathname.startsWith(DAEMON_PROXY_PREFIX)) {
280 return `/${pathname.slice(DAEMON_PROXY_PREFIX.length)}`;
281 }
282 return pathname;
283}
284
285function isSupportedDaemonRoute(route: string, method: string | undefined): boolean {
286 if (route === '/rpc') return method === 'POST';

Callers 1

handleProxyRequestFunction · 0.85

Calls 1

startsWithMethod · 0.80

Tested by

no test coverage detected