Remove addition of default address to IServerAddressesFeature when none is specified
This commit is contained in:
parent
8ea2edee77
commit
c8003c0305
|
|
@ -238,12 +238,6 @@ namespace Microsoft.AspNetCore.Hosting.Internal
|
|||
addresses.Add(value);
|
||||
}
|
||||
}
|
||||
|
||||
if (addresses.Count == 0)
|
||||
{
|
||||
// Provide a default address if there aren't any configured.
|
||||
addresses.Add("http://localhost:5000");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,12 +67,11 @@ namespace Microsoft.AspNetCore.Hosting
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void CanDefaultAddressesIfNotConfigured()
|
||||
public void NoDefaultAddressesIfNotConfigured()
|
||||
{
|
||||
var host = CreateBuilder().UseServer(this).Build();
|
||||
host.Start();
|
||||
Assert.NotNull(host.Services.GetService<IHostingEnvironment>());
|
||||
Assert.Equal("http://localhost:5000", host.ServerFeatures.Get<IServerAddressesFeature>().Addresses.First());
|
||||
Assert.Equal(false, host.ServerFeatures.Get<IServerAddressesFeature>().Addresses.Any());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Reference in New Issue