fix(core): Regex header values in traditional router are now validated
Summary
ATT
Checklist
- [x] The Pull Request has tests
- [x] A changelog file has been created under
changelog/unreleased/kongorskip-changeloglabel added on PR if changelog is unnecessary. README.md
Issue reference
Fix FTI-5403
what if someone want's a header to start with ~ but not to be treated as regex?
@nowNick It's not a problem for URL paths given every valid path begins with "/". Regex header inherits that design and we did not consider the issue. There is not a way to escape the "~", so something like "~1" can only be expressed with a trivial regex: "~~1".
Does the path typedef have logic in common with this new typedef? Can we refactor to simplify and avoid duplication?
@StarlightIbuki please review the comments above.
Does the
pathtypedef have logic in common with this new typedef? Can we refactor to simplify and avoid duplication?
Pathes have different requirements compared to headers. They need to start with slashes.
I've updated the PR to reuse the code as much as possible.
Successfully created cherry-pick PR for master:
- https://github.com/kong/kong-ee/pull/9512
In my impression, the headers are using ~* as the prefix of regex patterns. Would this be a breaking change? I see KIC's tests against the nightly images are failing.