Sha256: bb7ac0150c7a313f4c41dd7bfa8b3e71bd3b7d361a2ee26173b56d8c1a5875be
Contents?: true
Size: 504 Bytes
Versions: 26
Compression:
Stored size: 504 Bytes
Contents
/** * Return a total byte length of the given request/response body. * If the `Content-Length` header is present, it will be used as the byte length. */ export async function getBodyByteLength( input: Request | Response ): Promise<number> { const explicitContentLength = input.headers.get('content-length') if (explicitContentLength != null && explicitContentLength !== '') { return Number(explicitContentLength) } const buffer = await input.arrayBuffer() return buffer.byteLength }
Version data entries
26 entries across 26 versions & 1 rubygems