From 8b9fa042feb47c7099440f24f3b0e0ea2481d753 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Sat, 23 Jan 2016 14:05:09 -0500 Subject: [PATCH] If the path is not correct, don't fail due to existence check, fail due to unsupported path --- vault/core.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vault/core.go b/vault/core.go index a904c4658..e3adb5d2a 100644 --- a/vault/core.go +++ b/vault/core.go @@ -762,7 +762,13 @@ func (c *Core) checkToken(req *logical.Request) (*logical.Auth, *TokenEntry, err // or creation as appropriate. if req.Operation == logical.CreateOperation || req.Operation == logical.UpdateOperation { checkExists, resourceExists, err := c.router.RouteExistenceCheck(req) - if err != nil { + switch err { + case logical.ErrUnsupportedPath: + // fail later via bad path to avoid confusing items in the log + checkExists = false + case nil: + // Continue on + default: c.logger.Printf("[ERR] core: failed to run existence check: %v", err) return nil, nil, ErrInternalError }