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

Function isLoopbackHttpUrl

packages/core/sdk/src/oauth-helpers.ts:65–77  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

63}
64
65export const isLoopbackHttpUrl = (value: string): boolean => {
66 if (!URL.canParse(value)) return false;
67 const url = new URL(value);
68 if (url.protocol !== "http:") return false;
69 const hostname = url.hostname.toLowerCase();
70 return (
71 hostname === "localhost" ||
72 hostname === "0.0.0.0" ||
73 hostname === "::1" ||
74 hostname === "[::1]" ||
75 hostname.startsWith("127.")
76 );
77};
78
79export const isSupportedOAuthEndpointUrl = (
80 value: string,

Callers 3

registerDynamicClientFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected