Skip to content

Commit

Permalink
Fix for Akka.Cluster.Routing.ClusterRouterGroupSettings Mono Linux is…
Browse files Browse the repository at this point in the history
…sue #1332
  • Loading branch information
evertmulder committed Oct 2, 2015
1 parent 43291fa commit dbbd2ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/core/Akka.Tests/Actor/RelativeActorPathSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ public void RelativeActorPath_must_match_single_name()
Elements("foo").ShouldBe(new List<string>(){"foo"});
}

[Fact]
public void RelativeActorPath_starting_with_slash_must_match_single_name()
{
Elements("/foo").ShouldBe(new List<string>() { "foo" });
}


[Fact]
public void RelativeActorPath_must_match_path_separated_names()
{
Expand Down
10 changes: 5 additions & 5 deletions src/core/Akka/Actor/Address.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ public static IEnumerable<string> Unapply(string addr)
{
try
{
Uri uri;
bool isRelative = Uri.TryCreate(addr, UriKind.Relative, out uri);
if (!isRelative) return null;

var finalAddr = addr;
// need to add a special case for URI fragments containing #, since those don't get counted
// as relative URIs by C#
if(Uri.IsWellFormedUriString(addr, UriKind.Absolute) || (!Uri.IsWellFormedUriString(addr, UriKind.Relative)
&& !addr.Contains("#"))) return null;
if(!addr.StartsWith("/"))
if (!addr.StartsWith("/"))
{
//hack to cause the URI not to explode when we're only given an actor name
finalAddr = "/" + addr;
Expand Down

0 comments on commit dbbd2ac

Please sign in to comment.