'Validate a routespec
- Checks host value vs host-based routing.
- Ensures trailing slash on path.'

def validate_routespec(self, routespec):

    if (routespec == '/'):
        return routespec
    host_route = (not routespec.startswith('/'))
    if (host_route and (not self.host_routing)):
        raise ValueError(('Cannot    add    host-based    route    %r,    not    using    host-routing' % routespec))
    if (self.host_routing and (not host_route)):
        raise ValueError(('Cannot    add    route    without    host    %r,    using    host-routing' % routespec))
    if (not routespec.endswith('/')):
        return (routespec + '/')
    else:
        return routespec
