Skip to content

A loader that throws a non-redirect Response, or returns data() with a status, on a data request makes the server reject #153

Description

@KyleJune

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions