| 421 | } |
| 422 | |
| 423 | get stream(): Stream.Stream<Uint8Array, Error.HttpServerError> { |
| 424 | return this.source.body |
| 425 | ? BunStream.fromReadableStream({ |
| 426 | evaluate: () => this.source.body ?? emptyReadbleStream, |
| 427 | onError: (cause) => |
| 428 | new Error.HttpServerError({ |
| 429 | reason: new Error.RequestParseError({ |
| 430 | request: this, |
| 431 | cause |
| 432 | }) |
| 433 | }) |
| 434 | }) |
| 435 | : Stream.fail( |
| 436 | new Error.HttpServerError({ |
| 437 | reason: new Error.RequestParseError({ |
| 438 | request: this, |
| 439 | description: "can not create stream from empty body" |
| 440 | }) |
| 441 | }) |
| 442 | ) |
| 443 | } |
| 444 | |
| 445 | private textEffect: Effect.Effect<string, Error.HttpServerError> | undefined |
| 446 | get text(): Effect.Effect<string, Error.HttpServerError> { |