diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-04-05 15:34:45 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-04-05 15:34:45 -0400 |
| commit | 3ac2002759c324aef82c62fcf6cf54ab30ca8dcf (patch) | |
| tree | 17dc51494308788966ddaa9d1569f34dc42da686 | |
| parent | f15e534d41a1f34bb7492671c4590f11303ed39a (diff) | |
normalize user specified external address
| -rw-r--r-- | MediaBrowser.Server.Implementations/Connect/ConnectManager.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs index 9ed67f77e..e308acef0 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs @@ -62,6 +62,17 @@ namespace MediaBrowser.Server.Implementations.Connect { var address = _config.Configuration.WanDdns; + if (!string.IsNullOrWhiteSpace(address)) + { + try + { + address = new Uri(address).Host; + } + catch + { + } + } + if (string.IsNullOrWhiteSpace(address) && DiscoveredWanIpAddress != null) { if (DiscoveredWanIpAddress.AddressFamily == AddressFamily.InterNetworkV6) @@ -237,8 +248,8 @@ namespace MediaBrowser.Server.Implementations.Connect var postData = new Dictionary<string, string> { - {"name", _appHost.FriendlyName}, - {"url", wanApiAddress}, + {"name", _appHost.FriendlyName}, + {"url", wanApiAddress}, {"systemId", _appHost.SystemId} }; |
