Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kricsleo
Copy link
Member

resolves #1229

@kricsleo kricsleo requested a review from pi0 as a code owner October 25, 2025 14:57
@pi0
Copy link
Member

pi0 commented Oct 27, 2025

Thank you for the PR. It is kinda a wanted behavior since in Nitro for example we allow mounting a hono sub-app as middleware and if it returns new Response(404), rest of the app routing works.

I have added a test to show feature here: 8791818

Now i'm thinking if we could find a way to have both.

@pi0
Copy link
Member

pi0 commented Oct 27, 2025

OK lets make it explicit for Nitro usecase ~> #1234

@pi0 pi0 changed the title fix(middleware): allow returning 404 response in middleware fix: allow returning custom Response with 404 code as middleware Oct 27, 2025
@pi0 pi0 changed the title fix: allow returning custom Response with 404 code as middleware fix: allow returning custom Response with 404 code inside middleware Oct 27, 2025
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@pi0 pi0 merged commit f4fc544 into h3js:main Oct 27, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

onError returning new Response(404)

2 participants