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

Function isLoopbackHttpUrl

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

Source from the content-addressed store, hash-verified

116}
117
118export const isLoopbackHttpUrl = (value: string): boolean => {
119 if (!URL.canParse(value)) return false;
120 const url = new URL(value);
121 if (url.protocol !== "http:") return false;
122 const hostname = url.hostname.toLowerCase();
123 return (
124 hostname === "localhost" ||
125 hostname === "0.0.0.0" ||
126 hostname === "::1" ||
127 hostname === "[::1]" ||
128 hostname.startsWith("127.")
129 );
130};
131
132export const isSupportedOAuthEndpointUrl = (
133 value: string,

Callers 3

registerDynamicClientFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected