MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / sameServerOrigin

Function sameServerOrigin

apps/cli/src/main.ts:2899–2909  ·  view source on GitHub ↗
(left: string, right: string)

Source from the content-addressed store, hash-verified

2897const originPort = (url: URL): string => url.port || (url.protocol === "https:" ? "443" : "80");
2898
2899const sameServerOrigin = (left: string, right: string): boolean => {
2900 const leftUrl = new URL(normalizeExecutorServerConnection({ origin: left }).origin);
2901 const rightUrl = new URL(normalizeExecutorServerConnection({ origin: right }).origin);
2902 if (leftUrl.toString() === rightUrl.toString()) return true;
2903 return (
2904 leftUrl.protocol === rightUrl.protocol &&
2905 originPort(leftUrl) === originPort(rightUrl) &&
2906 LOCAL_SERVICE_HOSTS.has(leftUrl.hostname.toLowerCase()) &&
2907 LOCAL_SERVICE_HOSTS.has(rightUrl.hostname.toLowerCase())
2908 );
2909};
2910
2911const hasReachableCliDaemonManifest = (input: {
2912 readonly origin: string;

Calls 3

originPortFunction · 0.85
toStringMethod · 0.80

Tested by

no test coverage detected