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(core) stop percent decoding regex path #9024

Merged
merged 9 commits into from
Jul 7, 2022

Conversation

StarlightIbuki
Copy link
Contributor

@StarlightIbuki StarlightIbuki commented Jun 28, 2022

It's not a very reliable and sound way to support percent-encoding in regex. We choose to tell users that we have a normalized (standard) form to match with so there's no ambiguity.

#8140 (comment)

fix CT-344

@StarlightIbuki
Copy link
Contributor Author

Percent decoding of router.path is an undocumented feature, so we don't need a change to document for this PR.

@StarlightIbuki
Copy link
Contributor Author

StarlightIbuki commented Jun 28, 2022

A tricky problem:
We support 2.8 DP with 3.0 CP. When a CP migrates the path format to 3.0 and syncs the config to 2.8 DP, it may have different behavior.

We need a "back migration" to change the config back to 2.8 formats.

It's safe to leave most of the characters not changed (and we can not tell if they are not from origin config but decoded in migration). The only character that may cause problems is "%", and it may be double normalize_regexed by 2.8 DP.

kong/db/migrations/core/016_280_to_300.lua Show resolved Hide resolved
kong/db/migrations/core/016_280_to_300.lua Show resolved Hide resolved
kong/db/migrations/core/016_280_to_300.lua Outdated Show resolved Hide resolved
kong/db/migrations/core/016_280_to_300.lua Outdated Show resolved Hide resolved
spec/01-unit/08-router_spec.lua Outdated Show resolved Hide resolved
@StarlightIbuki StarlightIbuki force-pushed the fix/stop-percent-decoding-regex-path branch from e15a692 to 14084ec Compare June 30, 2022 04:09
@StarlightIbuki
Copy link
Contributor Author

I've tested migration in my local env and it works as expected.

It's not a very reliable and sound way to support percent encoding in regex. We choose to tell users that we have a normalized (standard) form to match with so there's no ambiguity.

fix CT-344
@StarlightIbuki StarlightIbuki force-pushed the fix/stop-percent-decoding-regex-path branch from 4bb71f0 to e736b5c Compare July 4, 2022 02:49
@fffonion fffonion merged commit 64ebac8 into master Jul 7, 2022
@fffonion fffonion deleted the fix/stop-percent-decoding-regex-path branch July 7, 2022 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants