fix(combine): return a Response from a short-circuiting middleware in some() (#5391)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* fix(combine): return a Response from a short-circuiting middleware in some() A middleware that short-circuits returns a `Response` without calling `next()`, which does not assign `c.res`. `some()` matched the result against `true` and `false`, then dropped it, so the context was never finalized and hono-base threw "Context is not finalized", surfacing as a 500. `every()` has handled this since #3441, whose description is the same report for the sibling: validators and `cors()` on OPTIONS return a Response rather than calling `next()`. `some()` was not part of that change. Keeps the Response and returns it. A `true` that reaches the same branch because the context is already finalized is excluded, so a Condition is still never used as a response. * docs(combine): remove redundant comments ---------
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Co-authored-by: Taku Amano <taku@taaas.jp>
Diff stats
2 files+21 added−0 removed
- tests:+17 added−0 removed
- other:+4 added−0 removed