| 12 | /** @internal */ |
| 13 | export const make = Platform.make({ |
| 14 | fileResponse(path, status, statusText, headers, start, end, contentLength) { |
| 15 | const stream = Fs.createReadStream(path, { start, end }) |
| 16 | return ServerResponse.raw(stream, { |
| 17 | headers: { |
| 18 | ...headers, |
| 19 | "content-type": headers["content-type"] ?? Mime.getType(path) ?? "application/octet-stream", |
| 20 | "content-length": contentLength.toString() |
| 21 | }, |
| 22 | status, |
| 23 | statusText |
| 24 | }) |
| 25 | }, |
| 26 | fileWebResponse(file, status, statusText, headers, _options) { |
| 27 | return ServerResponse.raw(Readable.fromWeb(file.stream() as any), { |
| 28 | headers: Headers.merge( |