Merge "Fix response status for invalid routes"

This commit is contained in:
Zuul 2018-07-26 02:18:05 +00:00 committed by Gerrit Code Review
commit 1baaacfa3a
3 changed files with 8 additions and 2 deletions

View File

@ -105,7 +105,7 @@ class SecretController(controllers.ACLMixin):
pecan.abort(405)
else:
# only 'acl' and 'metadata' as sub-resource is supported
pecan.abort(405)
pecan.abort(404)
@pecan.expose(generic=True)
def index(self, **kwargs):

View File

@ -230,7 +230,7 @@ class WhenTestingSecretACLsResource(utils.BarbicanAPIBaseTestCase,
resp = self.app.get(
'/secrets/{0}/incorrect_acls'.format(secret_id),
expect_errors=True)
self.assertEqual(405, resp.status_int)
self.assertEqual(404, resp.status_int)
def test_full_update_secret_acls_modify_project_access_value(self):
"""ACLs full update with userids where project-access flag modified."""

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fixed the response code for invalid subroutes for individual secrets. The
API was previously responding with the incorrect code "406 - Method not
allowed", but now responds correctly with "404 - Not Found".