MCPcopy Index your code
hub / github.com/colbymchenry/codegraph / httpsGet

Function httpsGet

src/upgrade/index.ts:207–221  ·  view source on GitHub ↗
(
  url: string,
  headers: Record<string, string>,
  timeoutMs: number
)

Source from the content-addressed store, hash-verified

205// ---------------------------------------------------------------------------
206
207function httpsGet(
208 url: string,
209 headers: Record<string, string>,
210 timeoutMs: number
211): Promise<{ status: number; headers: Record<string, string | string[] | undefined>; body: string }> {
212 return new Promise((resolve, reject) => {
213 const req = https.get(url, { headers }, (res) => {
214 let body = '';
215 res.on('data', (c) => (body += c));
216 res.on('end', () => resolve({ status: res.statusCode ?? 0, headers: res.headers, body }));
217 });
218 req.on('error', reject);
219 req.setTimeout(timeoutMs, () => req.destroy(new Error(`request timed out after ${timeoutMs}ms`)));
220 });
221}
222
223/**
224 * Resolve the latest release tag (e.g. `v0.9.9`).

Callers 1

resolveLatestVersionFunction · 0.85

Calls 4

getMethod · 0.65
onMethod · 0.65
resolveFunction · 0.50
destroyMethod · 0.45

Tested by

no test coverage detected