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

Function isLoopbackHttpUrl

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

Source from the content-addressed store, hash-verified

142}
143
144export const isLoopbackHttpUrl = (value: string): boolean => {
145 if (!URL.canParse(value)) return false;
146 const url = new URL(value);
147 if (url.protocol !== "http:") return false;
148 const hostname = url.hostname.toLowerCase();
149 return (
150 hostname === "localhost" ||
151 hostname === "0.0.0.0" ||
152 hostname === "::1" ||
153 hostname === "[::1]" ||
154 hostname.startsWith("127.")
155 );
156};
157
158export const isSupportedOAuthEndpointUrl = (
159 value: string,

Callers 3

registerDynamicClientFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected