(accessor: Accessor)
| 53 | // Echoes the body read through `accessor`, along with the request's |
| 54 | // Content-Encoding and Content-Length as the app sees them. |
| 55 | const echo = (accessor: Accessor) => (request: HttpServerRequest.HttpServerRequest) => |
| 56 | Effect.map(readers[accessor](request), (body) => |
| 57 | HttpServerResponse.text(body, { |
| 58 | headers: { |
| 59 | "x-content-encoding": request.headers["content-encoding"] ?? "", |
| 60 | "x-content-length": request.headers["content-length"] ?? "" |
| 61 | } |
| 62 | })) |
| 63 | |
| 64 | const echoApp = (accessor: Accessor) => HttpServerRequest.HttpServerRequest.use(echo(accessor)) |
| 65 |
no test coverage detected