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

Function isLoopbackHttpUrl

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

Source from the content-addressed store, hash-verified

132}
133
134export const isLoopbackHttpUrl = (value: string): boolean => {
135 if (!URL.canParse(value)) return false;
136 const url = new URL(value);
137 if (url.protocol !== "http:") return false;
138 const hostname = url.hostname.toLowerCase();
139 return (
140 hostname === "localhost" ||
141 hostname === "0.0.0.0" ||
142 hostname === "::1" ||
143 hostname === "[::1]" ||
144 hostname.startsWith("127.")
145 );
146};
147
148export const isSupportedOAuthEndpointUrl = (
149 value: string,

Callers 3

registerDynamicClientFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected