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. |
| { | ||
| public class ConfigurableResolverFactory : ResolverFactory | ||
| { | ||
| private static readonly BalancerAttributesKey<string> HostOverrideKey = new BalancerAttributesKey<string>("HostOverride"); |
There was a problem hiding this comment.
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.
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.