Skip to content

fix(http-host-matching): make http host matching case insensitive - #4605

Open
anthoturc wants to merge 1 commit into
mainfrom
anthoturc/http-host-matching
Open

fix(http-host-matching): make http host matching case insensitive#4605
anthoturc wants to merge 1 commit into
mainfrom
anthoturc/http-host-matching

Conversation

@anthoturc

Copy link
Copy Markdown
Contributor

this will ensure that the host name matching is RFC compliant w.r.t DNS names (i.e. case-insensitive)

@anthoturc
anthoturc marked this pull request as ready for review August 17, 2026 19:14
@anthoturc
anthoturc requested a review from a team as a code owner August 17, 2026 19:14

@adleong adleong 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.

I notice that in some places we're normalizing to lowercase and in other places we're doing a case insensitive compare. Do we need both?

@anthoturc

Copy link
Copy Markdown
Contributor Author

I think we need both.

I had added the normalization for the case where the HTTPRoute had a host defined in an unexpected way "Example.Com" vs "example.com" (which are the same).

The case-insensitive check is there for the runtime Host header/authority value (which can be anything). During my testing, I saw that the http crate's host() function (on the authority) would return the original Host header without normalizing it.

@anthoturc
anthoturc force-pushed the anthoturc/http-host-matching branch from 68f7d11 to 3a81bbc Compare August 18, 2026 19:05
@anthoturc

Copy link
Copy Markdown
Contributor Author

after some offline discussion, Alex and I agreed that we don't strictly need the normalization logic since the case-insensitive match check covers us even when the control plane sends "weird" looking host names.

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.

2 participants