kong
kong copied to clipboard
fix(router): host matches should be case insensitive as per RFC 3986
Summary
fix(router) host matches should be case insensitive as per RFC 3986
RFC3986 (section 3.2.2) states that host header is case insensitive.
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 - [ ] There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE
Issue reference
Fix FTI-6158
Still have a issue here is that when using expressions to configure routes, the expressions must be in lowercase. I still need to discuss the best solution with the team.
@ms2008 also what do you think about host normalization, and IDNA? One library that we have is capable of correctly normalizing the host (including the lowercasing and IDNA), see: https://github.com/bungle/lua-resty-ada?tab=readme-ov-file#synopsis
https://www.7‑Eleven.com:1234/Home/../Privacy/Montréal
->
https://www.xn--7eleven-506c.com:1234/Privacy/Montr%C3%A9al
Aka www.7‑Eleven.com -> www.xn--7eleven-506c.com?