kong icon indicating copy to clipboard operation
kong copied to clipboard

fix(router): host matches should be case insensitive as per RFC 3986

Open ms2008 opened this issue 11 months ago • 2 comments

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/kong or skip-changelog label 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

ms2008 avatar Jan 20 '25 08:01 ms2008

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 avatar Jan 21 '25 07:01 ms2008

@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?

bungle avatar Feb 05 '25 08:02 bungle