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 group.RouteNotFound not working when group has attached middlewares #2411

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

aldas
Copy link
Contributor

@aldas aldas commented Feb 23, 2023

Fix group.RouteNotFound not working when group has attached middlewares.

Problems is/was that g.Use registers special catch all routes with g.Any and those routes have priority over route registered by g.NotFoundHandler.
Solution is to register these special routes also with NotFoundHandler so if you register custom one - it will override special catch all.

Fixes #2401
For history sake: somewhat relates to #1981 , #2256 , #1728

@aldas aldas requested a review from lammel February 23, 2023 19:21
@aldas
Copy link
Contributor Author

aldas commented Feb 23, 2023

@lammel please review.

@codecov
Copy link

codecov bot commented Feb 23, 2023

Codecov Report

Base: 92.84% // Head: 92.84% // No change to project coverage 👍

Coverage data is based on head (35a7f4d) compared to base (47844c9).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2411   +/-   ##
=======================================
  Coverage   92.84%   92.84%           
=======================================
  Files          39       39           
  Lines        4503     4503           
=======================================
  Hits         4181     4181           
  Misses        234      234           
  Partials       88       88           
Impacted Files Coverage Δ
group.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@aldas aldas mentioned this pull request Feb 24, 2023
3 tasks
@aldas
Copy link
Contributor Author

aldas commented Feb 27, 2023

@lammel ping

@aldas aldas merged commit ec642f7 into labstack:master Mar 2, 2023
@lammel
Copy link
Contributor

lammel commented Mar 2, 2023

Sorry, late to the party.
For history sake: LGTM

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.

The 'RouteNotFound' have a bug
2 participants