'Creates identical handler without trailing star in pattern.
According to servlet spec, baz/* should match baz.
Args:
h: a Handler.
Returns:
If h.pattern is of form "baz/*", returns a singleton list with a
SimpleHandler with pattern "baz" and the properties of h. Otherwise,
returns an empty list.'

def CreateHandlerWithoutTrailingStar(self, h):

    if ((len(h.pattern) <= 2) or (h.pattern[(-2):] != '/*')):
        return []
    return [handler.SimpleHandler(h.pattern[:(-2)], h.properties)]
