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

Path filter doesn't take the end of the path expression into account #1140

Closed
solo-yolo opened this issue Sep 6, 2021 · 3 comments
Closed
Labels

Comments

@solo-yolo
Copy link

solo-yolo commented Sep 6, 2021

Description

I might have misunderstood it and it is expected behavior, but here's the deal :)

In my application I have two different HTTP endpoints, similar to the following:

  1. /profile/<user-id>/info
  2. /profile/summary

For the first endpoint, I don't want Logbook to log specific user ids, so I've set up the path filter:

PathFilters.replace("/profile/{user-id}/info", "hidden")

This works well, but it unintentionally filters out the path of the second endpoint as well, logging it as /profile/hidden/info.

Expected Behavior

I would expect a path filter with the expression /a/{b}/c does not match /a/b path since it doesn't end with /c.

Actual Behavior

It actually matches, without regard to the end of the expression.

Possible Fix

Didn't think about the fix yet.

Steps to Reproduce

I've created a unit test that reproduces the issue, #1139.

Your Environment

It is basically a spring-boot app, which exposes a few HTTP endpoints.

  • Version used: 2.11.0
  • Link to your project: it is a private repo.
@whiskeysierra
Copy link
Collaborator

@skjolber Thanks for the fix, much appreciated! 📣
@solo-yolo Thank you for reporting this! 📣

@solo-yolo
Copy link
Author

Thanks for such a quick fix! 👍🏻
Any chances it gonna be released soon?

@whiskeysierra
Copy link
Collaborator

I just released 2.13.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants