MCPcopy Index your code
hub / github.com/browserless/browserless / convertPathToURL

Function convertPathToURL

src/utils.ts:708–714  ·  view source on GitHub ↗
(url: string, config: Config)

Source from the content-addressed store, hash-verified

706 * @returns The full URL object
707 */
708export const convertPathToURL = (url: string, config: Config): URL => {
709 const external = config.getExternalAddress();
710 const fullInboundURL = new URL(url, external).href;
711 const internalPath = fullInboundURL.replace(external, '');
712
713 return new URL(internalPath, config.getServerAddress());
714};
715
716export const makeExternalURL = (
717 externalAddress: string,

Callers 2

handleRequestUnsafeMethod · 0.85
handleWebSocketUnsafeMethod · 0.85

Calls 2

getExternalAddressMethod · 0.80
getServerAddressMethod · 0.80

Tested by

no test coverage detected