Skip to content

Commit

Permalink
Trim trailing slashes when comparing pool URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
nwoolls committed Jan 14, 2015
1 parent ae0f1d7 commit 6acda82
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion MultiMiner.UX/ViewModels/ApplicationViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2806,7 +2806,12 @@ private Coin CoinConfigurationForPoolUrl(string poolUrl)
EngineConfiguration.CoinConfigurations
.FirstOrDefault(cc =>
cc.Pools
.Any(p => String.Format("{0}:{1}", p.Host.ShortHostFromHost(), p.Port).Equals(poolUrl.ShortHostFromHost(), StringComparison.OrdinalIgnoreCase))
.Any((p) => {
//trim trailing slashes
string configurationPool = String.Format("{0}:{1}", p.Host.ShortHostFromHost(), p.Port).TrimEnd('/');
string comparisonPool = poolUrl.ShortHostFromHost().TrimEnd('/');
return configurationPool.Equals(comparisonPool, StringComparison.OrdinalIgnoreCase);
})
);

return coinConfiguration;
Expand Down

0 comments on commit 6acda82

Please sign in to comment.