MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / buildRequestBody

Function buildRequestBody

out/cli.cjs:75768–75786  ·  view source on GitHub ↗
(request3, parts, boundary)

Source from the content-addressed store, hash-verified

75766 if (partLength === void 0) {
75767 return void 0;
75768 } else {
75769 total += partLength;
75770 }
75771 }
75772 return total;
75773}
75774async function buildRequestBody(request3, parts, boundary) {
75775 const sources = [
75776 stringToUint8Array(`--${boundary}`, "utf-8"),
75777 ...parts.flatMap((part) => [
75778 stringToUint8Array("\r\n", "utf-8"),
75779 stringToUint8Array(encodeHeaders(part.headers), "utf-8"),
75780 stringToUint8Array("\r\n", "utf-8"),
75781 part.body,
75782 stringToUint8Array(`\r
75783--${boundary}`, "utf-8")
75784 ]),
75785 stringToUint8Array("--\r\n\r\n", "utf-8")
75786 ];
75787 const contentLength = getTotalLength(sources);
75788 if (contentLength) {
75789 request3.headers.set("Content-Length", contentLength);

Callers 1

sendRequestFunction · 0.85

Calls 5

stringToUint8ArrayFunction · 0.85
encodeHeadersFunction · 0.85
getTotalLengthFunction · 0.85
concatFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected