Skip to content

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

Merged
membphis merged 3 commits into
apache:masterfrom
spacewander:colon_match
Dec 30, 2020
Merged

change: don't treat route segment with ':' as parameter by default#3154
membphis merged 3 commits into
apache:masterfrom
spacewander:colon_match

Conversation

@spacewander

Copy link
Copy Markdown
Member

Fix #3134.

Signed-off-by: spacewander [email protected]

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

spacewander commented Dec 29, 2020

Copy link
Copy Markdown
Member Author

Another related issue: #2008
CC @Gary-Airwallex

@spacewander
spacewander requested a review from membphis December 29, 2020 09:51

@membphis membphis left a comment

Copy link
Copy Markdown
Member

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

Comment thread conf/config-default.yaml Outdated
# 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 <[email protected]>
Signed-off-by: spacewander <[email protected]>
@membphis

Copy link
Copy Markdown
Member

Signed-off-by: spacewander <[email protected]>
@spacewander

Copy link
Copy Markdown
Member Author

@membphis
Added.

@membphis membphis left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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