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

Service Discovery: Propagate original host name to HttpClient Host header #460

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

ReubenBond
Copy link
Member

Fixes #321

Extracts the original host from the input and propagates it through the Host header for HTTP requests.
Eg,
ServiceName = "basket" => Host = "basket"
ServiceName = "_grpc.basket" => Host = "basket"
ServiceName = "https://_grpc.basket" => Host = "basket"

Copy link
Member

@davidfowl davidfowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FeatureCollection 😄

@ReubenBond ReubenBond merged commit 8c3a122 into main Oct 24, 2023
4 checks passed
@ReubenBond ReubenBond deleted the fix/sd-host-name branch October 24, 2023 01:32
@davidfowl
Copy link
Member

@ReubenBond does this just get overwritten later by the SocketsHttpHandler?

cc @MihaZupan

@MihaZupan
Copy link
Member

If you manually set the Host header, that's the value we'll send.
For SNI, we'll use the host header as well, as long as it exists and looks like a valid value.

The fallback for both is making up a value based on the request uri.

@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Service Discovery HttpClient integration correctly sets Host header
4 participants