(file, status, statusText, headers, options)
| 44 | return Response.raw(file, { headers, status, statusText }) |
| 45 | }, |
| 46 | fileWebResponse(file, status, statusText, headers, options) { |
| 47 | const start = Number(options?.offset ?? 0) |
| 48 | const end = options?.bytesToRead !== undefined ? start + Number(options.bytesToRead) : undefined |
| 49 | const body = start > 0 || end !== undefined |
| 50 | ? (file as File).slice(start, end, file.type) |
| 51 | : file |
| 52 | return Response.raw(body, { headers, status, statusText }) |
| 53 | } |
| 54 | }) |
| 55 | |
| 56 | /** |