-
Notifications
You must be signed in to change notification settings - Fork 810
Remove host override from container sample #2109
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
Remove host override from container sample #2109
Conversation
Is this a pattern we expect actual users to (have to?) apply? Seems convoluted. Edit: and now I see #2110 😆 |
Users are unlikely ever to want to do this. The sample does this because it displays the host IP to make it clear that load balancing is happening. |
Maybe include a comment to that effect so people don't start copying it into their own apps without understanding? |
Consume #2110? |
The sample references a NuGet package. It needs to be released and published before the sample can use it. That is a couple of months away. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable.
{ | ||
public class ConfigurableResolverFactory : ResolverFactory | ||
{ | ||
private static readonly BalancerAttributesKey<string> HostOverrideKey = new BalancerAttributesKey<string>("HostOverride"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little curious why we don't work directly with "HostOverride"
, rather than wrapping and unwrapping it, but I'm assuming this is idiomatic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its a pattern copied from the HttpRequestOptions
collection. It's designed to make the collection feel a little more strongly typed.
#2002 added a host override to the DNS resolver. Usually this is good. However, in the container sample we want to access the original IP address.