MCPcopy Create free account
hub / github.com/callstack/agent-device / resolveHttpRequestBaseUrl

Function resolveHttpRequestBaseUrl

src/daemon/upload-http.ts:298–304  ·  view source on GitHub ↗
(req: http.IncomingMessage)

Source from the content-addressed store, hash-verified

296}
297
298function resolveHttpRequestBaseUrl(req: http.IncomingMessage): string {
299 const host = typeof req.headers.host === 'string' ? req.headers.host : '';
300 if (!host) throw new AppError('INVALID_ARGS', 'Missing host header');
301 const forwardedProto = req.headers['x-forwarded-proto'];
302 const proto = Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto;
303 return `${proto || 'http'}://${host}`;
304}

Callers 1

handleUploadPreflightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…