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

Function isLoopbackHttpUrl

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

Source from the content-addressed store, hash-verified

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

Callers 3

registerDynamicClientFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected