(request3, parts, boundary)
| 75766 | if (partLength === void 0) { |
| 75767 | return void 0; |
| 75768 | } else { |
| 75769 | total += partLength; |
| 75770 | } |
| 75771 | } |
| 75772 | return total; |
| 75773 | } |
| 75774 | async 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); |
no test coverage detected