From ff2781e3b4f4c1aa25488b780836aca258300a9d Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 3 Feb 2016 14:05:29 -0500 Subject: [PATCH] Oops, we needed that, but for a different reason than the comment said. So put the test back but fix the comment --- vault/logical_cubbyhole.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vault/logical_cubbyhole.go b/vault/logical_cubbyhole.go index 795dc31adb..5c87885c30 100644 --- a/vault/logical_cubbyhole.go +++ b/vault/logical_cubbyhole.go @@ -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 '//' path := req.Path - if !strings.HasSuffix(path, "/") { + if path != "" && !strings.HasSuffix(path, "/") { path = path + "/" }