Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Honor PreferHostingUrls #1655

Merged
merged 1 commit into from
Apr 14, 2017
Merged

Honor PreferHostingUrls #1655

merged 1 commit into from
Apr 14, 2017

Conversation

JunTaoLuo
Copy link
Contributor

Addresses #1575. Alternative to #1639

We want to override the endpoints configured in the listen options when PreferHostingUrls is set to true with the addresses in the IServerAddressesFeature if it's not empty.

Will squash with a meaningful commit message once ready to merge.

@JunTaoLuo
Copy link
Contributor Author

@Tratcher
Copy link
Member

This is going to conflict with my Start/Stop PR that I'm merging tomorrow.

@JunTaoLuo
Copy link
Contributor Author

Go ahead and merge your changes for startasync/stopasync. I'll rework this PR.

Copy link
Contributor

@natemcmaster natemcmaster left a comment

Choose a reason for hiding this comment

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

One minor nit, then :shipit:

}

[ConditionalFact]
[PortSupportedCondition(5000)]
Copy link
Contributor

Choose a reason for hiding this comment

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

The test uses 5001, not 5000.

@JunTaoLuo JunTaoLuo force-pushed the johluo/use-hosting-urls branch from 840ddd2 to 2398330 Compare April 13, 2017 07:59
if (hasListenOptions)
{
var joined = string.Join(", ", _serverAddresses.Addresses);
_logger.LogWarning($"Overriding endpoints defined in UseKestrel() since {nameof(IServerAddressesFeature.PreferHostingUrls)} is set to true. Binding to address(es) '{joined}' instead.");
Copy link
Member

Choose a reason for hiding this comment

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

This is something that we expect to happen when PreferHostingUrls is set to true. Is this worth a warning? Or should we log as info?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll log as info.

@halter73
Copy link
Member

Rebase ofc.

@JunTaoLuo JunTaoLuo force-pushed the johluo/use-hosting-urls branch from 88f7795 to 08f9056 Compare April 14, 2017 00:43
@JunTaoLuo JunTaoLuo force-pushed the johluo/use-hosting-urls branch from 6b676d8 to 0723d46 Compare April 14, 2017 01:13
@JunTaoLuo JunTaoLuo merged commit 0723d46 into dev Apr 14, 2017
@JunTaoLuo JunTaoLuo deleted the johluo/use-hosting-urls branch April 14, 2017 01:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants