Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(middleware/combine): prevent c.req.routeIndex from being changed #3663

Merged
merged 3 commits into from
Nov 13, 2024

Conversation

usualoma
Copy link
Member

fixes #3657

As I also refactored the relevant parts, there are a lot of changes, but the key point is that c.req.routeIndex must not be changed’ in the following line.

https://github.com/honojs/hono/compare/main...usualoma:hono:fix/conbine-every-route-index?expand=1#diff-0127ebff640ea2834e4434792875961100daac21bcdaae2d033a6a59815da3bfR98

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code
  • Add TSDoc/JSDoc to document the code

usualoma and others added 3 commits November 13, 2024 14:39
The current implementation of `compose` does not use some elements of the received middleware,
so they do not have to be passed on.
@usualoma usualoma changed the title Fix/conbine every route index fix(middleware/combine): prevent c.req.routeIndex from being changed Nov 13, 2024
Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.70%. Comparing base (7b30835) to head (6a97bab).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3663   +/-   ##
=======================================
  Coverage   91.69%   91.70%           
=======================================
  Files         159      159           
  Lines       10140    10145    +5     
  Branches     2877     2876    -1     
=======================================
+ Hits         9298     9303    +5     
  Misses        840      840           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

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

LGTM!

@yusukebe
Copy link
Member

@usualoma

Ah, c.req.routeIndex! Indeed, we have to care about it. Looks good. Thanks!

@yusukebe yusukebe merged commit 4349735 into honojs:main Nov 13, 2024
16 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.

every middleware does not pass param to the wrapped middleware if global middleware is present
2 participants