diff --git a/app/swagger.json b/app/swagger.json index 7cf6a7dc1..ad7b1500e 100644 --- a/app/swagger.json +++ b/app/swagger.json @@ -355,7 +355,7 @@ "200": { "description": "Cluster resources removed" }, - "403": { + "404": { "description": "Cluster not found" }, "500": { diff --git a/app/utils/cluster.js b/app/utils/cluster.js index 407816529..e11dd4b12 100644 --- a/app/utils/cluster.js +++ b/app/utils/cluster.js @@ -142,7 +142,7 @@ const getCluster = async (req, res, next) => { const Clusters = req.db.collection('clusters'); const cluster = await Clusters.findOne({ org_id: req.org._id, cluster_id: cluster_id }); if (!cluster) { - res.status(403).send(`Cluster ${cluster_id} not found`); + res.status(404).send(`Cluster ${cluster_id} not found`); return; } req.cluster = cluster; // eslint-disable-line require-atomic-updates diff --git a/app/utils/cluster.tests.js b/app/utils/cluster.tests.js index 9a10b0651..fb5dbc94c 100644 --- a/app/utils/cluster.tests.js +++ b/app/utils/cluster.tests.js @@ -112,7 +112,7 @@ describe('utils', () => { assert.equal(response.statusCode, 401); }); - it('should return 403 if cannot find cluster', async () => { + it('should return 404 if cannot find cluster', async () => { // Setup var request = httpMocks.createRequest({ method: 'POST', @@ -140,7 +140,7 @@ describe('utils', () => { assert.equal(nextCalled, false); - assert.equal(response.statusCode, 403); + assert.equal(response.statusCode, 404); }); it('should call next', async () => {