Per our discussion, we should allow a trailing slash. So the easy thing to do here is to remove a trailing slash before splitting.