Oops, we needed that, but for a different reason than the comment said. So put the test back but fix the comment

This commit is contained in:
Jeff Mitchell 2016-02-03 14:05:29 -05:00
parent fd4283b430
commit 63d63e8dbc
1 changed files with 4 additions and 4 deletions

View File

@ -154,11 +154,11 @@ func (b *CubbyholeBackend) handleList(
return nil, fmt.Errorf("[ERR] cubbyhole list: Client token empty")
}
// Right now we only handle directories, so ensure it ends with /
// Unlike passthrough, we'll never have a case of listing "/" so we don't
// need to check if the path is empty
// Right now we only handle directories, so ensure it ends with / We also
// check if it's empty so we don't end up doing a listing on '<client
// token>//'
path := req.Path
if !strings.HasSuffix(path, "/") {
if path != "" && !strings.HasSuffix(path, "/") {
path = path + "/"
}