Skip to content

Commit

Permalink
Fix #7918 Root path spec
Browse files Browse the repository at this point in the history
cleaner logic

Signed-off-by: Greg Wilkins <gregw@webtide.com>
  • Loading branch information
gregw committed Apr 26, 2022
1 parent 9c8f99e commit 4fe55e2
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -199,12 +199,12 @@ public Iterator<MappedResource<E>> iterator()

public static PathSpec asPathSpec(String pathSpecString)
{
if ((pathSpecString == null) || (pathSpecString.length() < 1))
{
if (pathSpecString != null)
return new ServletPathSpec("");
if (pathSpecString == null)
throw new RuntimeException("Path Spec String must start with '^', '/', or '*.': got [" + pathSpecString + "]");
}

if (pathSpecString.length() == 0)
return new ServletPathSpec("");

return pathSpecString.charAt(0) == '^' ? new RegexPathSpec(pathSpecString) : new ServletPathSpec(pathSpecString);
}

Expand Down

0 comments on commit 4fe55e2

Please sign in to comment.