Check for path component length
If someone makes a call against '/org' for instance
we die checking for the attr action because there is
only path one component to the URL.
diff --git a/phosphor-rest b/phosphor-rest
index 08065ed..4c13b08 100644
--- a/phosphor-rest
+++ b/phosphor-rest
@@ -275,10 +275,10 @@
if path.parts[-1] == 'enumerate':
return EnumerateHandler(self, path.fq(last = -1), data)
- if path.parts[-2] == 'attr':
+ if path.depth() > 1 and path.parts[-2] == 'attr':
return AttrHandler(self, path.fq(last = -2), data)
- if path.parts[-2] == 'action':
+ if path.depth() > 1 and path.parts[-2] == 'action':
return MethodHandler(self, path.fq(last = -2), data)
# have to do an objectmapper query at this point