Found during review of #152. It happens on main without #152's change.
Behavior
On a data request (client navigation), a loader that:
- throws a non-redirect `Response`, or
- returns `data(value, { status, headers })`
makes `server.request` reject. Hono only passes `Error` instances to `onError`, so under `Deno.serve` the request ends as a generic 500 and the response's own headers, including `Set-Cookie`, are lost.
Acceptance
- Both cases produce a data response with the intended status and the response's own headers (cookies included), and don't reject.
- There are tests for a thrown `Response` and for `data()` with a status and headers, on data requests.
Found during review of #152. It happens on main without #152's change.
Behavior
On a data request (client navigation), a loader that:
makes `server.request` reject. Hono only passes `Error` instances to `onError`, so under `Deno.serve` the request ends as a generic 500 and the response's own headers, including `Set-Cookie`, are lost.
Acceptance