(url: URL)
| 128 | * i.e. /<port>/ide + route returns just route |
| 129 | */ |
| 130 | export function getMaybeProxiedPathname(url: URL): string { |
| 131 | if (process.env.USE_PROXY === "1") { |
| 132 | // Behind proxy, path will be /<port>/ide + route |
| 133 | const pathWithoutProxy = url.pathname.split(`/${REVERSE_PROXY_BASE_PATH}`)[1] |
| 134 | return pathWithoutProxy |
| 135 | } |
| 136 | |
| 137 | return url.pathname |
| 138 | } |
| 139 | |
| 140 | interface FakeVscodeSockets { |
| 141 | /* If called, closes all servers after the first connection. */ |
no outgoing calls
no test coverage detected