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

Function checkUrl

scripts/check-owned-links.js:81–96  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

79}
80
81async function checkUrl(url) {
82 try {
83 const headStatus = await fetchStatus(url, 'HEAD');
84 if (isReachableStatus(headStatus)) {
85 return { ok: true, status: headStatus, method: 'HEAD' };
86 }
87
88 const getStatus = await fetchStatus(url, 'GET');
89 return { ok: isReachableStatus(getStatus), status: getStatus, method: 'GET' };
90 } catch (error) {
91 return {
92 ok: false,
93 error: error instanceof Error ? error.message : String(error),
94 };
95 }
96}
97
98async function main() {
99 const urlSources = new Map();

Callers 1

workerFunction · 0.85

Calls 2

fetchStatusFunction · 0.85
isReachableStatusFunction · 0.85

Tested by

no test coverage detected