Skip to content

Commit 0e676c0

Browse files
authored
- Fix error with previous commit #1005 issue 105225 parsing service uri (#1012)
1 parent 1dd2844 commit 0e676c0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

dotnet/src/dotnetcore/GxClasses.Web/Middleware/GXRouting.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,14 @@ internal string GetGxRouteValue(string path)
351351
}
352352
public bool ServiceInPath(String path, out String actualPath)
353353
{
354+
actualPath = null;
354355
string tmppath = path.Substring(0, 1).Equals("/") ? path.Substring(1) : path;
355356
int pos = tmppath.IndexOf("/");
356-
string innerPath = tmppath.Substring(pos, tmppath.Length - pos);
357-
actualPath = FindPath( innerPath, servicesPathUrl, true);
357+
if (pos > 0)
358+
{
359+
string innerPath = tmppath.Substring(pos, tmppath.Length - pos);
360+
actualPath = FindPath(innerPath, servicesPathUrl, true);
361+
}
358362
if (String.IsNullOrEmpty(actualPath))
359363
{
360364
// fallback

0 commit comments

Comments
 (0)