( headers: Record<string, string>, startOffset: number, payloadSize: number, )
| 212 | } |
| 213 | |
| 214 | function buildUploadRequestHeaders( |
| 215 | headers: Record<string, string>, |
| 216 | startOffset: number, |
| 217 | payloadSize: number, |
| 218 | ): Record<string, string | number> { |
| 219 | if (startOffset <= 0) return headers; |
| 220 | return { |
| 221 | ...headers, |
| 222 | 'content-length': Math.max(payloadSize - startOffset, 0), |
| 223 | 'content-range': `bytes ${startOffset}-${payloadSize - 1}/${payloadSize}`, |
| 224 | }; |
| 225 | } |
| 226 | |
| 227 | function isUploadRedirectStatus(statusCode: number): boolean { |
| 228 | return [301, 302, 303, 307, 308].includes(statusCode); |
no outgoing calls
no test coverage detected