MCPcopy Index your code
hub / github.com/codeaashu/claude-code / buildHeaders

Method buildHeaders

web/lib/api/files.ts:36–45  ·  view source on GitHub ↗
(extra?: Record<string, string>)

Source from the content-addressed store, hash-verified

34 private initPromise: Promise<void> | null = null;
35
36 private buildHeaders(extra?: Record<string, string>): Record<string, string> {
37 const headers: Record<string, string> = {
38 "Content-Type": "application/json",
39 ...extra,
40 };
41 const key = getApiKey();
42 if (key) headers["Authorization"] = `Bearer ${key}`;
43 if (this.sessionId) headers["mcp-session-id"] = this.sessionId;
44 return headers;
45 }
46
47 private async doInitialize(): Promise<void> {
48 const res = await fetch(`${getBaseUrl()}/mcp`, {

Callers 2

doInitializeMethod · 0.95
callToolMethod · 0.95

Calls 1

getApiKeyFunction · 0.70

Tested by

no test coverage detected