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

Do not handle special trailing slash case for partial prefix #1741

Merged
merged 2 commits into from Jan 3, 2021

Conversation

stffabi
Copy link
Contributor

@stffabi stffabi commented Dec 29, 2020

Only handle the special trailing slash case if the whole prefix
matches. Otherwise we might be using a completely wrong
route, e.g. /users/* for the path /users_prefix/ where
the route is only a partial prefix of the requested path.

Fixes #1739

@codecov
Copy link

codecov bot commented Dec 29, 2020

Codecov Report

Merging #1741 (3077952) into master (c7c792d) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1741   +/-   ##
=======================================
  Coverage   86.75%   86.75%           
=======================================
  Files          29       29           
  Lines        2069     2069           
=======================================
  Hits         1795     1795           
  Misses        175      175           
  Partials       99       99           
Impacted Files Coverage Δ
router.go 97.05% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7c792d...3077952. Read the comment docs.

router.go Show resolved Hide resolved
@lammel lammel added bug unconfirmed Possible bug, but needs to be reproduced first. labels Jan 2, 2021
Only handle the special trailing slash case if the whole prefix
matches. Otherwise we might be using a completely wrong
route, e.g. /users/* for the path /users_prefix/ where
the route is only a partial prefix of the requested path.
@stffabi stffabi requested a review from lammel January 3, 2021 01:45
@lammel lammel merged commit a9df830 into labstack:master Jan 3, 2021
@lammel
Copy link
Contributor

lammel commented Jan 3, 2021

Thanks for your contribution @stffabi!

@stffabi stffabi deleted the fix-any-prefix branch January 3, 2021 22:33
@stffabi
Copy link
Contributor Author

stffabi commented Jan 3, 2021

@lammel awesome thank you very much for merging this in. Are there any plans for a new release in the near future?

@lammel
Copy link
Contributor

lammel commented Jan 4, 2021

Yes, a new release is expected within the next days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unconfirmed Possible bug, but needs to be reproduced first.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"any" routing bug if path and any route share prefix
2 participants