MCPcopy Create free account
hub / github.com/di-sukharev/opencommit / buildHeaders

Method buildHeaders

out/cli.cjs:69689–69702  ·  view source on GitHub ↗
({ options, headers, contentLength })

Source from the content-addressed store, hash-verified

69687 headers: reqHeaders,
69688 ...httpAgent && { agent: httpAgent },
69689 // @ts-ignore node-fetch uses a custom AbortSignal type that is
69690 // not compatible with standard web types
69691 signal: options.signal ?? null
69692 };
69693 return { req, url: url2, timeout };
69694 }
69695 buildHeaders({ options, headers, contentLength }) {
69696 const reqHeaders = {};
69697 if (contentLength) {
69698 reqHeaders["content-length"] = contentLength;
69699 }
69700 const defaultHeaders = this.defaultHeaders(options);
69701 applyHeadersMut(reqHeaders, defaultHeaders);
69702 applyHeadersMut(reqHeaders, headers);
69703 if (isMultipartBody(options.body) && kind !== "node") {
69704 delete reqHeaders["content-type"];
69705 }

Callers 1

buildRequestMethod · 0.80

Calls 6

applyHeadersMutFunction · 0.85
isMultipartBodyFunction · 0.85
applyHeadersMut2Function · 0.85
isMultipartBody2Function · 0.85
defaultHeadersMethod · 0.80
validateHeadersMethod · 0.80

Tested by

no test coverage detected