( body: Stream.Stream<Uint8Array, E>, options?: Options | undefined )
| 472 | * @since 4.0.0 |
| 473 | */ |
| 474 | export const stream = <E>( |
| 475 | body: Stream.Stream<Uint8Array, E>, |
| 476 | options?: Options | undefined |
| 477 | ): HttpServerResponse => { |
| 478 | const headers = options?.headers |
| 479 | ? Headers.fromInput(options.headers) |
| 480 | : Headers.empty |
| 481 | return makeResponse({ |
| 482 | status: options?.status ?? 200, |
| 483 | statusText: options?.statusText, |
| 484 | headers, |
| 485 | cookies: options?.cookies, |
| 486 | body: Body.stream( |
| 487 | body, |
| 488 | getContentType(options, headers), |
| 489 | options?.contentLength |
| 490 | ) |
| 491 | }) |
| 492 | } |
| 493 | |
| 494 | const HttpPlatformKey = Context.Service< |
| 495 | HttpPlatform, |
no test coverage detected