info: protect stripTrailingSlashes against invalid input and zero length