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

Further clarification on hostname matching and forwarding when Host header includes a port #2091

Closed
sunjayBhatia opened this issue Jun 5, 2023 · 2 comments · Fixed by #2092
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@sunjayBhatia
Copy link
Member

sunjayBhatia commented Jun 5, 2023

What would you like to be added:
In #1980 we added clarification that implementations MUST ignore a port included in the HTTP Host header.

Implicitly, the test added also asserts that the backend will receive the original Host header with the port intact (e.g. the test/request with Host: very.specific.com:1234 will forward that Host header unchanged to the backend).

Is this a desired behavior? If so, we should explicitly document it in the API spec so users/implementers expect it. If not, again we should document it.

Why this is needed:
Specificity in the API documentation/tests.

Further Notes:

  • Contour at the moment (and I believe at least Envoy Gateway) strips any port from the host header and does not forward it to the backend.
  • We added this port strip behavior in Contour to ensure we can do wildcard hostname matching in Envoy, Envoy only allows a wildcard prefix or suffix hostname match, *.foo.com or foo.com:* but not *.foo.com:*. We can likely come up with an implementation that fulfills whatever spec, but just noting this as Envoy-based implementations may not be conformant with this test for a bit depending on how they are implemented and what is decided. See here
  • It looks like Istio has a similar issue as described above, since Envoy does not allow double-ended wildcard hostname matching, from here
@sunjayBhatia sunjayBhatia added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 5, 2023
@howardjohn
Copy link
Contributor

IMO it is desired, we should not modify the user's request.

For envoy you want IgnorePortInHostMatching

@sunjayBhatia
Copy link
Member Author

Ah nice, thats a new field since I looked at this last 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants