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

change: don't treat route segment with ':' as parameter by default #3154

Merged
merged 3 commits into from
Dec 30, 2020

Conversation

spacewander
Copy link
Member

Fix #3134.

Signed-off-by: spacewander spacewanderlzx@gmail.com

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@spacewander spacewander changed the title fix: match route with ':' change: don't treat route segment with ':' as parameter by default Dec 29, 2020
@spacewander spacewander marked this pull request as ready for review December 29, 2020 09:50
@spacewander
Copy link
Member Author

spacewander commented Dec 29, 2020

Another related issue: #2008
CC @Gary-Airwallex

Copy link
Member

@membphis membphis left a comment

Choose a reason for hiding this comment

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

In this case, how about creating a new router?

eg: radixtree_uri, radixtree_uri_no_parameter

This configuration is not easy to understand and find.

https://github.com/apache/apisix/pull/3154/files#diff-8d872babc717e9d733641b56bfc530ef98751fbe4e68f08d79b2b83109c22fffR122-R123

@@ -119,6 +119,8 @@ apisix:
# control:
# ip: "127.0.0.1"
# port: 9090
feature:
enable_parameter_in_route: false # allow using ':param' in the router. See https://github.com/api7/lua-resty-radixtree/#parameters-in-path
Copy link
Member

Choose a reason for hiding this comment

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

We need to find a better way

Copy link
Member Author

Choose a reason for hiding this comment

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

@membphis
rewritten.

@spacewander
Copy link
Member Author

We decide to use radixtree_uri_with_parameter instead after discussion.

Fix apache#3134.

You can still get the original behavior by using
radixtree_uri_with_parameter router.

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
@membphis
Copy link
Member

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
@spacewander
Copy link
Member Author

@membphis
Added.

Copy link
Member

@membphis membphis left a comment

Choose a reason for hiding this comment

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

LGTM

@membphis membphis merged commit 81c1c7c into apache:master Dec 30, 2020
@membphis
Copy link
Member

many thx, merged

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.

I have some trouble on route match
3 participants