Merge pull request #963 from hashicorp/fail-unsup-path

If the path is not correct, don't fail due to existence check, fail d…
This commit is contained in:
Jeff Mitchell 2016-01-23 14:05:32 -05:00
commit e772a3e695
1 changed files with 7 additions and 1 deletions

View File

@ -762,7 +762,13 @@ func (c *Core) checkToken(req *logical.Request) (*logical.Auth, *TokenEntry, err
// or creation as appropriate. // or creation as appropriate.
if req.Operation == logical.CreateOperation || req.Operation == logical.UpdateOperation { if req.Operation == logical.CreateOperation || req.Operation == logical.UpdateOperation {
checkExists, resourceExists, err := c.router.RouteExistenceCheck(req) 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) c.logger.Printf("[ERR] core: failed to run existence check: %v", err)
return nil, nil, ErrInternalError return nil, nil, ErrInternalError
} }