MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / validateCrawlDomain

Function validateCrawlDomain

server/src/utils/url-security.ts:116–123  ·  view source on GitHub ↗
(domain: string)

Source from the content-addressed store, hash-verified

114 * Returns the normalized domain on success, throws on validation failure.
115 */
116export async function validateCrawlDomain(domain: string): Promise<string> {
117 const normalized = domain.toLowerCase().trim();
118 if (!DOMAIN_RE.test(normalized)) {
119 throw new Error('Invalid domain format');
120 }
121 await validateHostResolution(normalized);
122 return normalized;
123}
124
125/**
126 * Validate an externally-reachable URL the server will contact on the caller's

Callers 3

createRegistryApiRouterFunction · 0.85

Calls 2

validateHostResolutionFunction · 0.85
trimMethod · 0.65

Tested by

no test coverage detected