(requestUrl: string)
| 274 | } |
| 275 | |
| 276 | function 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 | |
| 285 | function isSupportedDaemonRoute(route: string, method: string | undefined): boolean { |
| 286 | if (route === '/rpc') return method === 'POST'; |
no test coverage detected